E_ElecCompetition/Electrical_inspectionCompet.../Assets/Script/Interactive objects/Doorchange.cs

60 lines
1.1 KiB
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Doorchange : MonoBehaviour
{
public door_control[] door_Control;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
private void OnTriggerExit(Collider other)
{
if (other.name == "Player")
{
for (int i = 0; i < door_Control.Length; i++)
{
door_Control[i]. = false;
if (door_Control[i]. == true)
{ door_Control[i].animator.Play(door_Control[i].); }
}
}
}
private void OnTriggerEnter(Collider other)
{
if (other.name == "Player")
{
for (int i = 0; i < door_Control.Length; i++)
{
door_Control[i]. = true;
//door_Control[i].animator.Play(door_Control[i].关门动画);
}
}
}
}