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

19 lines
432 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.Close.isOn = true;
}
}
}