-
Notifications
You must be signed in to change notification settings - Fork 0
/
cuisson.cs
34 lines (32 loc) · 1.01 KB
/
cuisson.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class cuisson : MonoBehaviour
{
void OnTriggerEnter(Collider other)
{
if (other.CompareTag("ingredient"))
{
cuisson_ingredient ingredientScript = other.GetComponent<cuisson_ingredient>();
// Vérifier si le composant existe
if (ingredientScript != null)
{
// Activer la cuisson de l'ingrédient
ingredientScript.StartCooking();
}
}
}
void OnTriggerExit(Collider other)
{
if (other.CompareTag("ingredient"))
{
cuisson_ingredient ingredientScript = other.GetComponent<cuisson_ingredient>();
// Vérifier si le composant existe
if (ingredientScript != null)
{
// Désactiver la cuisson de l'ingrédient
ingredientScript.StopCooking();
}
}
}
}