public void Damage() { Health -= 10; if (Health < 1) { IsDead = true; Animator.SetTrigger("Dead"); GameObject DiamondPreCoount = Instantiate(DiamondPrefab, transform.position, Quaternion.identity) as GameObject; Debug.Log("Germs :" + germs); DiamondPreCoount.GetComponent <Diamond>().germs += base.germs; EmenySoundEffect.clip = DeadSound; EmenySoundEffect.Play(); Invoke("DestoryInSeconds", 2.0f); } }
public void Damage() { Debug.Log("hit"); Health -= 10; IsHit = true; Animator.SetTrigger("IsHit"); Animator.SetBool("IsCombat", true); if (IsHit == true) { EmenySoundEffect.clip = AttackSound; EmenySoundEffect.Play(); } if (Health < 1) { IsDead = true; Animator.SetTrigger("Dead"); GameObject DiamondPreCoount = Instantiate(DiamondPrefab, transform.position, Quaternion.identity) as GameObject; DiamondPreCoount.GetComponent <Diamond>().germs += base.germs; Invoke("DestoryInSeconds", 2f); } }
public void Attack() { Instantiate(AcidPrefab, transform.position, Quaternion.identity); EmenySoundEffect.clip = AttackSound; EmenySoundEffect.Play(); }