Example #1
0
 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);
     }
 }
Example #2
0
    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);
        }
    }
Example #3
0
 public void Attack()
 {
     Instantiate(AcidPrefab, transform.position, Quaternion.identity);
     EmenySoundEffect.clip = AttackSound;
     EmenySoundEffect.Play();
 }