Ejemplo n.º 1
0
    IEnumerator UpdateScoreIfNeeded()
    {
        int counter = 1;

        yield return(StartCoroutine(GetLapScore.GetTimes()));

        yield return(new WaitForSeconds(1));

        foreach (string s in GetLapScore.times.Split('~'))
        {
            if (s == "")
            {
                break;
            }
            Debug.LogError(s);
            string[] sA = s.Split('|');
            if (int.Parse(sA[1]) == int.Parse(SceneManager.GetActiveScene().name.Remove(0, 5)) - 1)
            {
                Debug.LogWarning(sA[5]);
                if (timer < int.Parse(sA[5]))
                {
                    StartCoroutine(UpdateLapScore.UpdateScores((int.Parse(SceneManager.GetActiveScene().name.Remove(0, 5)) - 1).ToString(), Mathf.Ceil(timer).ToString(), counter));
                    break;
                }
            }
            counter++;
        }
    }
Ejemplo n.º 2
0
 public void ResetTimes()
 {
     StartCoroutine(UpdateLapScore.UpdateScores("0", "1234", 1));
 }