예제 #1
0
파일: Boss.cs 프로젝트: LudumDareOsd/ld45
    public void NextPhase()
    {
        state = (BossState)((int)state + 1);
        //Debug.Log("BOSS IN PHASE: " + state.ToString());

        if (state == BossState.INTRO)
        {
            StartCoroutine(Appear());
            audioController.PlaySingle(appearSound, 0.7f);
        }

        if (state == BossState.PHASE1)
        {
            StopCoroutine(Appear());
            leftEye.ToggleOpen();
            eyeToggle = 0.0f;
        }

        if (state == BossState.PHASE2)
        {
            StartCoroutine(Evade());
            bigEyeToggle = 2.5f;
        }

        if (state == BossState.REVIVE)
        {
            StartCoroutine(Regenerate());
        }

        if (state == BossState.PHASE3)
        {
            StopCoroutine(Regenerate());
            leftEye.SwitchState(EyeState.OPEN);
            rightEye.SwitchState(EyeState.CLOSED);
            bigEye.SwitchState(EyeState.CLOSED);
            eyeToggle        = 0.0f;
            bigEyeToggle     = 2.5f;
            moveSmoothing    = 1.7f;
            eyeSprite.sprite = angryEyes;
        }

        else if (state == BossState.DEAD)
        {
            gameController.Win();
            audioController.PlaySingle(deathSound, 0.7f);
            Destroy(gameObject);
        }
    }