You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
|
|
|
|
public class EventChecker : MonoBehaviour
|
|
|
|
|
{
|
|
|
|
|
[Header("是否开启区域语音提示")]
|
|
|
|
|
public bool isOpenSoundTip = false;
|
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
|
|
|
{
|
|
|
|
|
if (other.gameObject.tag == "Car")
|
|
|
|
|
{
|
|
|
|
|
Car car;
|
|
|
|
|
car = other.gameObject.GetComponent<Car>();
|
|
|
|
|
if (car != null)
|
|
|
|
|
{
|
|
|
|
|
if (isOpenSoundTip)
|
|
|
|
|
{
|
|
|
|
|
// DriveManager.Instance.SetCarSoundTip(car);
|
|
|
|
|
}
|
|
|
|
|
if (car.canOverTake)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
DriveManager.Instance.SetEventCar(car);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
Debug.Log("SS");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnTriggerExit(Collider other)
|
|
|
|
|
{
|
|
|
|
|
if (other.gameObject.tag == "Car")
|
|
|
|
|
{
|
|
|
|
|
DriveManager.Instance.ClearEventCar();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|