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(); } } }
IEnumerator OpenDivineShieldCoroutine(float duration) { float timer = 0f; playerHealth.SetIsProtectedByDivineShield(true); while (true) { timer += Time.deltaTime; if (timer > duration) { SkillManager.GetInstance().StopParticle(this.skillEntity.skillInfo.singingParticle); playerHealth.SetIsProtectedByDivineShield(false); skillEntity.Complete(); Destroy(this); yield break; } yield return(new WaitForEndOfFrame()); } }