Exemplo n.º 1
0
    void TestAttackPropultion()
    {
        Vector3 direction = Vector3.zero;

        Collider[] colls     = Physics.OverlapBox(transform.position + transform.forward * 0.2f + transform.right * 0.1f, new Vector3(.5f, .5f, .5f), transform.rotation);
        bool       blocked   = false;
        bool       hitplayer = false;

        foreach (Collider coll in colls)
        {
            if (coll.tag == "Player" && coll.gameObject != this.gameObject)
            {
                hitplayer = true;
                direction = (coll.transform.position - transform.position).normalized;
                blocked   = blocked || coll.GetComponent <PlayerController>().Push(direction, chargingAttack * damage, index);
            }
        }
        charging = false;
        anim.SetBool("charging", false);
        anim.SetBool("attack_blocked", blocked);

        if (blocked)
        {
            audioManager.PlaySound(MotherFuckingAudioManager.SoundList.PARADE);
            StartCoroutine(CounterMalusEmplification());
            StartCoroutine(ChargeAnim(-direction, 1f, 0f));
        }
        else
        {
            if (!hitplayer)
            {
                audioManager.PlaySound(MotherFuckingAudioManager.SoundList.WOOSH);
            }
            else
            {
                audioManager.PlaySound(MotherFuckingAudioManager.SoundList.HIT);
            }
        }
    }
 public void Woosh()
 {
     audioManager.PlaySound(MotherFuckingAudioManager.SoundList.WOOSH);
 }
 void Start()
 {
     audioManager.PlaySound(MotherFuckingAudioManager.SoundList.WIND, true);
 }