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()); } } } }
void Start() { has = GetComponent <HitAudioSource>(); pc = enemy.GetComponent <PaladinController>(); }
void Start() { pc = enemy.GetComponent <PaladinController>(); }