コード例 #1
0
    //敵と衝突時の処理
    private IEnumerator Do_Hit_Attack_Process()
    {
        if (knock_Back)
        {
            float force = _controller.is_Landing ? 170f : 30f;                  //ノックバック
            _rigid.velocity = new Vector2(force * -transform.localScale.x, 10f);
        }
        player_SE.Play_Hit_Attack_Sound();                                  //効果音
        float tmp = Time.timeScale;                                         //ヒットストップ

        Time.timeScale = 0.4f;
        yield return(new WaitForSeconds(0.05f));

        Time.timeScale = tmp;
    }
コード例 #2
0
    //強攻撃
    private IEnumerator Charge_Attack_Cor()
    {
        _anim.SetTrigger("AttackTrigger");
        attack_Collision.Make_Collider_Appear(0.18f);
        player_SE.Play_Attack_Sound();
        player_SE.Play_Hit_Attack_Sound();

        _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())
            {
                StartCoroutine("Do_Hit_Attack_Process");
                yield return(new WaitForSeconds(0.05f));

                break;
            }
            yield return(null);
        }
    }
コード例 #3
0
 //キックのヒット時の処理
 private void Do_Hit_Kick_Process()
 {
     _rigid.velocity = new Vector2(30f * -transform.localScale.x, 160f); //ノックバック
     player_SE.Play_Hit_Attack_Sound();                                  //効果音
 }