using System.Collections; using System.Collections.Generic; using UnityEngine; public class jiansudai : MonoBehaviour { private void OnTriggerEnter(Collider other) { if ( other.gameObject.tag == "Car") { if (other.GetComponent() != null) { other.GetComponent().driveStatu = CarDriveStatu.怠速; } } } private void OnTriggerExit(Collider other) { if ( other.gameObject.tag == "Car") { } } }