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.

38 lines
867 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SpeedChecker : MonoBehaviour
{
private Car car;
private void Start()
{
if (GameManagerForZhuanWan.Instance != null)
{
GameManagerForZhuanWan.Instance.ZhuanWanData.RigsterChecker(this.name, this.gameObject);
}
}
private void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Car")
{
car = other.GetComponent<Car>();
GameManagerForZhuanWan.Instance.SetInfoPanelSpeed(car.overSpeed);
if (car.overSpeed > DriveManager.Instance.OverSpeedMaxValue-5f)
{
DriveManager.Instance.SetCarSoundTip(car);
}
}
}
private void OnTriggerExit(Collider other)
{
car = null;
}
}