Ejemplo n.º 1
0
    IEnumerator Stage1Transition()
    {
        PlayerMovement playerMovement = player.GetComponent <PlayerMovement>();

        playerMovement.StartCoroutine(playerMovement.GoToThePositonAndLookCenter(8));
        yield return(TimeSlowDown());

        screenShaker.Call(10, 3);
        yield return(new WaitWhile(() => screenShaker.active));

        Transform bossTransform = boss.transform;

        while (bossTransform.position.y > -16)
        {
            yield return(new WaitForFixedUpdate());

            bossTransform.position += Vector3.down * .3f;
        }

        yield return(new WaitForSeconds(.5f));

        Animator bossAnimator = boss.GetComponent <Animator>();

        bossAnimator.enabled = true;
        bossAnimator.SetTrigger("Show");
        tempBossVoice.PlayDelayed(.1f);
        bossTransform.position = new Vector2(bossTransform.position.x, -6);

        yield return(new WaitForSeconds(2f));

        bossAnimator.enabled = false;
        BGMPlayer.Play();
        yield return(new WaitForSeconds(.5f));

        battleStart = DateTime.Now;
        stageTitle.SetCard(1);
        playerMovement.EndCutscene();
        bossAnimator.enabled = true;
        bossAnimator.SetTrigger("Summon");
        yield return(new WaitForSeconds(.3f));

        screenShaker.Call(15, 3);
        BossHealth bossHealth = boss.GetComponent <BossHealth>();

        bossHealth.StartCoroutine(bossHealth.Refill());
        yield return(new WaitForSeconds(2));

        bossAnimator.SetTrigger("Toggle");
    }