38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
public class BoxDools : MonoBehaviour
|
|
{
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
if (other != null)
|
|
{
|
|
for (int i = 0; i < GameManager.ins.interactive.Count; i++)
|
|
{
|
|
GameManager.ins.interactive[i].GetComponent<door_control>().启用交互 = true;
|
|
}
|
|
}
|
|
}
|
|
private void OnTriggerExit(Collider other)
|
|
{
|
|
if (other != null)
|
|
{
|
|
for (int i = 0; i < GameManager.ins.interactive.Count; i++)
|
|
{
|
|
GameManager.ins.interactive[i].GetComponent<door_control>().启用交互 = false;
|
|
if (GameManager.ins.interactive[i].GetComponent<door_control>().是否开门)
|
|
{
|
|
GameManager.ins.interactive[i].GetComponent<door_control>().animator.Play(GameManager.ins.interactive[i].GetComponent<door_control>().关门动画);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|