void OnCollisionEnter(Collision other) { // foreach (ContactPoint contact in other.contacts) // { // Debug.DrawRay(contact.point, contact.normal, Color.white); // } if (hitTargetSum < 1) { enemyGO = other.collider.gameObject; if ("ZomBear".Equals(enemyGO.tag) || "ZomBunny".Equals(enemyGO.tag) || "Hellephant".Equals(enemyGO.tag)) { skillEntity.PlaySkillAudio(); enemyGO.GetComponent <EnemyHealth> ().TakeDamage(skillEntity.skillInfo.intHP); enemyGO.GetComponent <EnemyMovement> ().FreezeEnemyForSeconds(2f); hitTargetSum++; SkillManager.GetInstance().StopParticle(skillEntity.skillInfo.releasingParticle); skillEntity.HitTarget(); skillEntity.Complete(); } } }
// Use this for initialization void Start() { playerHealth = transform.gameObject.GetComponent <PlayerHealth> (); if (skillEntity.skillInfo.duration > 0 && playerHealth != null) { skillEntity.PlaySkillAudio(); OpenDivineShield(skillEntity.skillInfo.duration); } }