IEnumerator UpdateVelocity() { while (true) { if (droneRacer != null) { velocityRate = (VelocityRate)PlayerPrefs.GetInt(Constants.VelocityIndicator); switch (velocityRate) { case VelocityRate.KilometersPerHour: Show(); text.text = string.Format("{0,3:0} KPH", droneRacer.kilometersPerHour); break; case VelocityRate.MilesPerHour: Show(); text.text = string.Format("{0,3:0} MPH", droneRacer.milesPerHour); break; case VelocityRate.Hidden: Hide(); break; } } else { droneRacer = DroneRacer.FindDroneRacer(); } yield return(new WaitForSeconds(updateFrequency)); } }
public void OnTriggerExit(Collider other) { //Debug.Log("OnTriggerExit other=" + other.name); DroneRacer qr = other.gameObject.GetComponent <DroneRacer>(); if (qr == DroneRacer.FindDroneRacer()) { airGate.AirGateThresholdTriggered(qr); } }
public static bool IsRaceInProgress() { bool retVal = false; if (IsReady() == true) { DroneRacer dr = DroneRacer.FindDroneRacer(); if (dr != null && dr.RaceStatus == RaceStatus.InProgress) { retVal = true; } } return(retVal); }