OnHealthChange() public method

public OnHealthChange ( ) : void
return void
Ejemplo n.º 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);
		}
	}
Ejemplo n.º 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);
     }
 }