Files
Shopkeeper/Assets/Scripts/ShopSystems/Puddle.cs
Caleb Sandford deQuincey 47944971ca initial game submission
2025-06-10 22:13:25 +01:00

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!");
}
}