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

35 lines
598 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class FireHydrant : MonoBehaviour
{
public 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);
}
}