Ejemplo n.º 1
0
    private IEnumerator AnnouncePowerUp(PowerUp powerUp)
    {
        powerUpText.GetComponent <TextMeshPro>().text = powerUp.powerUpMessage;

        yield return(MPAction.ScaleObject(powerUpText, Vector2.zero, Vector2.one, 0.5f, "easeineaseout", false, false, false, false));

        yield return(new WaitForSeconds(2f));

        StartCoroutine(MPAction.ScaleObject(powerUpText, Vector2.one, Vector2.zero, 0.5f, "easeineaseout", false, false, false, false));
    }
Ejemplo n.º 2
0
    protected override IEnumerator EngineBlownRoutine()
    {
        engineSmoke.Play();

        yield return(MPAction.ScaleObject(engineBlownText, Vector2.zero, Vector2.one, 0.25f, "easeineaseout", false, false, false, false));

        yield return(new WaitForSeconds(engineBlownTime - 0.5f));

        yield return(MPAction.ScaleObject(engineBlownText, Vector2.one, Vector2.zero, 0.25f, "easeineaseout", false, false, false, false));

        engineSmoke.Stop();
    }
Ejemplo n.º 3
0
    public IEnumerator PulsateCrashText()
    {
        Vector2 startSize   = Vector2.one;
        Vector2 endSize     = Vector2.one * 1.25f;
        float   pulsateTime = 0.5f;

        for (; ;)
        {
            yield return(MPAction.ScaleObject(crashText.gameObject, startSize, endSize, pulsateTime, "easeineaseout", false, false, false, false));

            yield return(MPAction.ScaleObject(crashText.gameObject, endSize, startSize, pulsateTime, "easeineaseout", false, false, false, false));
        }
    }
Ejemplo n.º 4
0
    private IEnumerator ScaleCloud()
    {
        float scaleTime = Random.Range(minTime, maxTime);

        for (; ;)
        {
            yield return(MPAction.ScaleObject(gameObject, minScale, maxScale,
                                              scaleTime, "easeineaseout", false, false, false, false));

            yield return(MPAction.ScaleObject(gameObject, maxScale, minScale,
                                              scaleTime, "easeineaseout", false, false, false, false));
        }
    }
Ejemplo n.º 5
0
    private IEnumerator PulsateIt()
    {
        Vector2 startSize        = Vector2.one;
        Vector2 endSize          = Vector2.one * 1.25f;
        float   timeForEachPulse = 1f;

        for (; ;)
        {
            yield return(MPAction.ScaleObject(gameObject, startSize, endSize, timeForEachPulse, "easeineaseout", false, false, false, false));

            yield return(MPAction.ScaleObject(gameObject, endSize, startSize, timeForEachPulse, "easeineaseout", false, false, false, false));
        }
    }
Ejemplo n.º 6
0
    private IEnumerator BeginRace()
    {
        float relativeTimeToDisplayNums = 0.5f;

        for (int i = 3; i > 0; i--)
        {
            countDown.GetComponent <TextMeshPro>().text = i.ToString();

            yield return(MPAction.ScaleObject(countDown, Vector2.zero, Vector2.one,
                                              countDownTime / 3f * (1f - relativeTimeToDisplayNums) * 0.5f, "easeineaseout", false, false, false, false));

            yield return(new WaitForSeconds(countDownTime / 3f * relativeTimeToDisplayNums));

            yield return(MPAction.ScaleObject(countDown, Vector2.one, Vector2.zero,
                                              countDownTime / 3f * (1f - relativeTimeToDisplayNums) * 0.5f, "easeineaseout", false, false, false, false));
        }

        countDown.SetActive(false);

        gameState = GameState.gameplay;
    }