_xiaofang/xiaofang/Assets/Script/npc/FireHydrant.cs

32 lines
595 B
C#
Raw Normal View History

2024-10-23 11:31:35 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class FireHydrant : MonoBehaviour
{
public GameObject xfs;
2024-10-23 11:31:35 +08:00
// Start is called before the first frame update
2024-10-23 20:48:23 +08:00
void Awake()
2024-10-23 11:31:35 +08:00
{
//xfs = GameObject.Find("Canvas/xfs");
2024-10-23 11:31:35 +08:00
}
// 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);
}
}