Example #1
0
    IEnumerator TopSpeedUp()
    {
        arcadeKart.SetTopSpeed(20f);
        StartCoroutine(NoticeOn());
        yield return(new WaitForSeconds(5f));

        arcadeKart.SetTopSpeed(SpeedInicial);
    }
Example #2
0
    IEnumerator TurboOn()
    {
        if (turboBars.Count > 0)
        {
            Destroy(GameObject.FindGameObjectWithTag("TurboBar"));
            turboBars.RemoveAt(turboBars.Count - 1);
        }
        playerKart.SetTopSpeed(20f);
        turboAnimation.SetActive(true);
        yield return(new WaitForSeconds(turboTime));

        turboAnimation.SetActive(false);
        playerKart.SetTopSpeed(initialSpeed);
    }