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));
            }
        }
Пример #2
0
        public void OnTriggerExit(Collider other)
        {
            //Debug.Log("OnTriggerExit other=" + other.name);
            DroneRacer qr = other.gameObject.GetComponent <DroneRacer>();

            if (qr == DroneRacer.FindDroneRacer())
            {
                airGate.AirGateThresholdTriggered(qr);
            }
        }
Пример #3
0
        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);
        }