Exemple #1
0
    void OnTriggerEnter(Collider other)
    {
        // for paladin
        if (other.gameObject.CompareTag("Enemy"))
        {
            if (motor.isAttacking)
            {
                pc = other.transform.GetComponent <PaladinController>();

                if (interactable)//&& !motor.isAttacked
                {
                    CameraShaker.Instance.ShakeOnce(4f, 4f, 0.1f, 1f);

                    if (pc.GetAnimator().GetCurrentAnimatorStateInfo(0).IsName("Block"))
                    {
                        // hot particles and iron hit sound effect
                        HotParticleEffect(other.transform);
                        has.RandomizeSfx(hitSwordClips);
                    }

                    else if (!pc.isAttacked)
                    {
                        pc.isAttacked = true;
                        StartCoroutine(SetFixedForPaladin());
                        //BloodEffect(other.transform);
                        HotParticleEffect(other.transform);
                        has.RandomizeSfx(hitBodyClips);

                        // slash sound effect
                    }
                    interactable = false;
                    StartCoroutine(SetFixed());
                }
            }
        }
    }
Exemple #2
0
 void Start()
 {
     has = GetComponent <HitAudioSource>();
     pc  = enemy.GetComponent <PaladinController>();
 }
Exemple #3
0
 void Start()
 {
     pc = enemy.GetComponent <PaladinController>();
 }