OnHealthChange() публичный Метод

public OnHealthChange ( ) : void
Результат void
Пример #1
0
	public void UsePowerUp(Avatar target) {
		if (birds != null) {
			for(int x = 0; x<6; x++) {
				GameObject bird = (GameObject) Instantiate (birds, target.transform.position, target.transform.rotation);
				//set avatar as proximity target
				OnProximity pox = bird.GetComponent<OnProximity>();
				pox.target = (GameObject) target.gameObject;
			}
			if (target.hp < 3) {
				target.hp+=1;
				target.OnHealthChange();
			}
			Destroy (this.gameObject);
		}
	}
Пример #2
0
 public void UsePowerUp(Avatar target)
 {
     if (birds != null)
     {
         for (int x = 0; x < 6; x++)
         {
             GameObject bird = (GameObject)Instantiate(birds, target.transform.position, target.transform.rotation);
             //set avatar as proximity target
             OnProximity pox = bird.GetComponent <OnProximity>();
             pox.target = (GameObject)target.gameObject;
         }
         if (target.hp < 3)
         {
             target.hp += 1;
             target.OnHealthChange();
         }
         Destroy(this.gameObject);
     }
 }