CQ_Intelligent-Technology-T.../Assets/Scripts/智慧交通/StopCarTrigger.cs

21 lines
560 B
C#

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// 挂载在停车杆触发器上,如果车辆过去 自动关闸
/// </summary>
public class StopCarTrigger : MonoBehaviour
{
private void OnTriggerExit(Collider other)
{
if (other.CompareTag("Car"))
{
ControlStopCar.instance.Controlpoles(true);
ControlStopCar.instance.Open.isOn = false;
ControlStopCar.instance.Open.interactable = true;
ControlStopCar.instance.Audiosbt.interactable = true;
}
}
}