_xiaofang/xiaofang/Assets/Script/npc/FireHydrant.cs
2024-10-23 20:48:23 +08:00

32 lines
594 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class FireHydrant : MonoBehaviour
{
private GameObject xfs;
// Start is called before the first frame update
void Awake()
{
xfs = GameObject.Find("Canvas/xfs");
}
// Update is called once per frame
void Update()
{
}
private void OnTriggerEnter(Collider other)
{
xfs.gameObject.SetActive(true);
}
private void OnTriggerExit(Collider other)
{
xfs.gameObject.SetActive(false);
}
}