Ejemplo n.º 1
0
    // ------------------------------------------------------------------------
    // BOSS - 攻撃1.
    // ------------------------------------------------------------------------
    private void Attack1()
    {
        // 攻撃1.
        if (state == State.ATTACK1START)
        {
            // ステータスを進める.
            state = State.ATTACK1END;

            // 機体が存在している時のみ攻撃可能.
            if (bulletMakerLeft || bulletMakerRight)
            {
                // アニメーション再生.
                bossAnimation.Play();

                // バルカン攻撃.
                if (bulletMakerLeft)
                {
                    bulletMakerLeft.SetIsFiring();
                }
                if (bulletMakerRight)
                {
                    bulletMakerRight.SetIsFiring();
                }

                StartCoroutine(WaitAndUpdateState(Attack1Time, State.ESCAPE2START));
            }
            else
            {
                // 機体がない場合は次の攻撃に移る.
                state = State.ATTACK2START;
            }
        }
    }
    // ------------------------------------------------------------------------
    // BOSS - 攻击1
    // ------------------------------------------------------------------------
    private void Attack1()
    {
        // 攻击1
        if (state == State.ATTACK1START)
        {
            // 修改状态
            state = State.ATTACK1END;

            // 只有当机体存在时才能攻击
            if (bulletMakerLeft || bulletMakerRight)
            {
                // 播放动画
                bossAnimation.Play();

                // 扫尾攻击
                if (bulletMakerLeft)
                {
                    bulletMakerLeft.SetIsFiring();
                }
                if (bulletMakerRight)
                {
                    bulletMakerRight.SetIsFiring();
                }

                StartCoroutine(WaitAndUpdateState(Attack1Time, State.ESCAPE2START));
            }
            else
            {
                // 如果没有机体则跳到下一次攻击
                state = State.ATTACK2START;
            }
        }
    }