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

59 lines
1016 B
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;
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].关门动画);
}
}
}
}