TG9six 03a642d635 first push
first push
2025-09-06 17:17:39 +04:00

39 lines
892 B
C#

using System;
using UnityEngine;
using UnityEngine.Rendering;
public class PPDetector : MonoBehaviour
{
public SphereCollider sphereCollider;
public GameObject waterForZone;
public GameObject waterBase;
private void Awake()
{
PlayerEntity.OnDetectPP += Activate;
PlayerEntity.OnDetectClosePP -= DeActivate;
}
private void Activate()
{
waterForZone.SetActive(true);
waterBase.SetActive(false);
}
private void DeActivate()
{
waterForZone.SetActive(false);
waterBase.SetActive(true);
}
private void OnDestroy()
{
PlayerEntity.OnDetectPP -= Activate;
PlayerEntity.OnDetectClosePP -= DeActivate;
}
private void OnDrawGizmosSelected()
{
Gizmos.color = Color.blue;
Gizmos.DrawSphere(this.transform.position, sphereCollider.radius);
}
}