E_ElecCompetition/Electrical_inspectionCompet.../Assets/Script/Interactive/BoxDools.cs

35 lines
972 B
C#
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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>().enabled = 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>().enabled = true;
GameManager.ins.interactive[i].GetComponent<door_control>().animator.Play(GameManager.ins.interactive[i].GetComponent<door_control>().¹ØÃů»­);
}
}
}
}