void AddFinishedLapTime(int lap)
        {
            TimeDisplayItem newItem = GetItem(lap);

            newItem.SetText(getTimeString(finishedLapTimes[lap]));
            newItem.SetTitle($"Lap {lap+1}:");
            newItem.gameObject.SetActive(true);
        }
Exemple #2
0
        void SetLaps(int laps)
        {
            for (int i = 0; i < laps; i++)
            {
                TimeDisplayItem newItem = timeDisplayItem.getObject(false, finishedLapsParent.transform).GetComponent <TimeDisplayItem>();
                finishedLapsParent.UpdateTable(newItem.gameObject);

                lapTimesText.Add(newItem);
            }
        }
Exemple #3
0
        TimeDisplayItem GetItem(int i)
        {
            if (i >= lapTimesText.Count)
            {
                TimeDisplayItem newItem = timeDisplayItem.getObject(false, finishedLapsParent.transform).GetComponent <TimeDisplayItem>();
                finishedLapsParent.UpdateTable(newItem.gameObject);
                lapTimesText.Add(newItem);
                return(newItem);
            }

            return(lapTimesText[i]);
        }
Exemple #4
0
        void AddFinishedLapTime(int lap)
        {
            TimeDisplayItem newItem = GetItem(lap);

            //Se comprueba si se ha superado el record para mostrarlo por pantalla
            if (bestCurrentTime > finishedLapTimes[lap] || bestCurrentTime < 0)
            {
                //Se actualiza el bestCurrentTime
                bestCurrentTime = finishedLapTimes[lap];

                //Muestra el nuevo record
                StartCoroutine(ShowNewRecordPopUp());
            }

            newItem.SetText(getTimeString(finishedLapTimes[lap]));
            newItem.SetTitle($"Lap {lap+1}:");
            newItem.gameObject.SetActive(true);
        }