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

33 lines
638 B
C#

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