22 lines
460 B
C#
22 lines
460 B
C#
using UnityEngine;
|
|
|
|
public class Puddle : MonoBehaviour
|
|
{
|
|
public bool isClean = false;
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
if (other.CompareTag("Customer") && !isClean)
|
|
{
|
|
if (Random.value < 0.3f)
|
|
other.GetComponent<CustomerAI>()?.Trip();
|
|
}
|
|
}
|
|
|
|
public void CleanUp()
|
|
{
|
|
isClean = true;
|
|
gameObject.SetActive(false);
|
|
Debug.Log("Puddle cleaned!");
|
|
}
|
|
} |