Example #1
0
    //被弾時の処理
    public IEnumerator Damaged()
    {
        if (GetComponentInChildren <PlayerBodyCollision>().Is_Invincible())
        {
            yield break;
        }
        if (PlayerManager.Instance.Reduce_Life() == 0)
        {
            yield break;
        }

        PlayerBodyCollision body_Collision = GetComponentInChildren <PlayerBodyCollision>();

        invincible_Time_Length = 2.0f;
        if (GetComponent <PlayerController>().Get_Is_Ride_Beetle())
        {
            invincible_Time_Length = 3.0f;
        }

        Put_Out_Power(PlayerManager.Instance.Get_Power() / 8);           //パワーの減少
        BeetlePowerManager.Instance.StartCoroutine("Increase_Cor", 25);  //飛行パワー増加
        StartCoroutine("Blink");                                         //点滅
        player_SE.Play_Damaged_Sound();                                  //効果音
        Occure_Knock_Back();                                             //反動
        body_Collision.Become_Invincible();                              //無敵化
        Play_Delete_Bullet_Bomb();                                       //弾消しようのボム

        yield return(new WaitForSeconds(invincible_Time_Length + 1.0f)); //無敵時間

        body_Collision.Release_Invincible();                             //戻す
    }
Example #2
0
    //会話
    virtual protected IEnumerator Talk()
    {
        is_Talking = true;
        end_Talk   = false;

        GameObject          player            = GameObject.FindWithTag("PlayerTag");
        PlayerController    player_Controller = player.GetComponent <PlayerController>();
        PlayerBodyCollision player_Collision  = player.GetComponentInChildren <PlayerBodyCollision>();

        talk_Count++;

        //会話開始
        if (player_Controller.Get_Is_Playable())
        {
            //自機を止める
            player_Controller.Set_Is_Playable(false);
            yield return(null);

            player.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0);
            player_Controller.Change_Animation("IdleBool");
            //自機無敵化
            player_Collision.Become_Invincible();
            //ポーズ禁止
            PauseManager.Instance.Set_Is_Pausable(false);

            yield return(new WaitForSeconds(Action_Before_Talk()));

            player.GetComponent <Rigidbody2D>().velocity = new Vector2(0, 0);

            //メッセージ表示
            if (dual_Panel)
            {
                _message_Custom.Start_Display(fileName, start_ID, end_ID);
                yield return(new WaitUntil(_message_Custom.End_Message));
            }
            else
            {
                _message.Start_Display(fileName, start_ID, end_ID);
                yield return(new WaitUntil(_message.End_Message));
            }
            //終了
            yield return(new WaitForSeconds(0.1f));

            player_Controller.Set_Is_Playable(true);
            player_Collision.Release_Invincible();
            PauseManager.Instance.Set_Is_Pausable(true);
        }

        Action_In_End_Talk();
        end_Talk   = true;
        is_Talking = false;
    }
Example #3
0
    //被弾時の処理
    public IEnumerator Damaged()
    {
        if (PlayerManager.Instance.Reduce_Life() == 0)
        {
            yield break;
        }

        PlayerBodyCollision body_Collision = GetComponentInChildren <PlayerBodyCollision>();

        Put_Out_Power(PlayerManager.Instance.Get_Power() / 8);      //パワーの減少
        StartCoroutine("Blink");                                    //点滅
        body_Collision.Become_Invincible();                         //無敵化
        Occure_Knock_Back();                                        //反動
        yield return(new WaitForSeconds(INVINCIBLE_TIME_LENGTH));   //無敵時間

        body_Collision.Release_Invincible();                        //戻す
    }
    private IEnumerator Kick_Cor(Kind kind)
    {
        accept_Input = false;

        //入力受付後500フレーム以内にキック可能になればキック
        float loop_Count = 0;

        while (!_controller.can_Attack)
        {
            yield return(null);

            loop_Count++;
            if (loop_Count > 500)
            {
                accept_Input = true;
                yield break;
            }
        }

        //キック開始
        _controller.can_Attack = false;
        _controller.Set_Is_Playable(false);
        _controller.Change_Animation("KickBool");

        player_Body.Change_Collider_Size(new Vector2(10, 12), new Vector2(0, -6));
        player_SE.Play_Kick_Sound();

        if (kind == Kind.kick || kind == Kind.sliding)
        {
            kick_Collision.Make_Collider_Appear(false);
            StartCoroutine("Kicking_Cor");
        }
        else
        {
            kick_Collision.Make_Collider_Appear(true);
            player_SE.Play_Charge_Shoot_Sound();
            Quit_Charge(true);
            player_Body.Become_Invincible();
            StartCoroutine("Charge_Kicking_Cor");
        }

        yield return(new WaitUntil(End_Kick));

        //キック終了
        if (_controller.is_Landing)
        {
            _controller.Change_Animation("IdleBool");
        }
        else
        {
            _controller.Change_Animation("JumpBool");
        }

        _controller.Set_Is_Playable(true);
        kick_Collision.Make_Collider_Disappear();
        player_Body.Back_Default_Collider();

        if (kind == Kind.charge_Kick || kind == Kind.charge_Sliding)
        {
            player_Body.Release_Invincible();
        }

        _controller.can_Attack = true;
        accept_Input           = true;
    }