Beispiel #1
0
    public IEnumerator Attack_Cor()
    {
        can_Attack = false;
        _anim.SetTrigger("AttackTrigger");

        attack_Collision.Make_Collider_Appear(0.18f);
        _rigid.velocity += new Vector2(transform.localScale.x * 5f, 0); //Rigidbodyのスリープ状態を解除する
        for (float t = 0; t < 0.18f; t += Time.deltaTime)
        {
            //敵と衝突時ノックバック
            if (attack_Collision.Hit_Trigger())
            {
                Occur_Knock_Back();
                BeetlePowerManager.Instance.StartCoroutine("Increase_Cor", 8);
                //ヒットストップ
                Time.timeScale = 0.5f;
                yield return(new WaitForSeconds(0.05f));

                Time.timeScale = 1.0f;
                break;
            }
            yield return(null);
        }

        yield return(new WaitForSeconds(0.17f));

        can_Attack = true;
    }
    //攻撃用コルーチン
    public IEnumerator Attack_Cor()
    {
        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;

        _anim.SetTrigger("AttackTrigger");
        attack_Collision.Make_Collider_Appear(attack_Time);
        player_SE.Play_Attack_Sound();

        switch (player_Manager.Get_Option())
        {
        case PlayerManager.Option.bee:      StartCoroutine("Bee_Shoot_Cor"); break;

        //case PlayerManager.Option.mantis:   Mantis_Shoot(); break;
        case PlayerManager.Option.butterfly: Butterfly_Jump(); break;

        case PlayerManager.Option.spider:   Gen_Spider_Footing(); break;
        }

        _rigid.velocity += new Vector2(transform.localScale.x * 5f, 0); //Rigidbodyのスリープ状態を解除する
        for (float t = 0; t < attack_Time; t += Time.deltaTime)
        {
            //敵と衝突時
            if (attack_Collision.Hit_Trigger())
            {
                StartCoroutine("Do_Hit_Attack_Process");
                yield return(new WaitForSeconds(0.05f));

                break;
            }
            yield return(null);
        }

        accept_Input = true;
        yield return(new WaitForSeconds(attack_Span));

        _controller.can_Attack = true;
    }
    //攻撃用コルーチン
    public IEnumerator Attack_Cor()
    {
        can_Attack = false;
        _anim.SetTrigger("AttackTrigger");
        attack_Collision.Make_Collider_Appear(attack_Time);
        player_SE.Play_Attack_Sound();

        if (player_Manager.Get_Option() == PlayerManager.Option.bee)    //オプションが蜂の時ショット
        {
            Bee_Shoot();
        }
        else if (player_Manager.Get_Option() == PlayerManager.Option.mantis) //オプションがカマキリの時ショット
        {
            Mantis_Shoot();
        }
        else if (player_Manager.Get_Option() == PlayerManager.Option.butterfly)  //オプションがチョウの時浮く
        {
            _rigid.velocity = new Vector2(_rigid.velocity.x, 200f);
        }

        _rigid.velocity += new Vector2(transform.localScale.x * 5f, 0); //Rigidbodyのスリープ状態を解除する
        for (float t = 0; t < attack_Time; t += Time.deltaTime)
        {
            //敵と衝突時
            if (attack_Collision.Hit_Trigger())
            {
                StartCoroutine("Do_Hit_Attack_Process");
                yield return(new WaitForSeconds(0.05f));

                break;
            }
            yield return(null);
        }

        yield return(new WaitForSeconds(attack_Span));

        can_Attack = true;
    }