Game Development Reference
In-Depth Information
36.
health,
37.
SendMessageOptions.DontRequireReceiver);
38.
}
39.
}
40.
}
41.
42.
//Deacrease health and inform other scripts about it
43.
public void DecreaseHealth(int amount){
44.
//Do nothing if the player is already dead
45.
if(IsDead()) return;
46.
47.
health -= amount;
48.
SendMessage("OnHealthDecrement",
49.
health,
50.
SendMessageOptions.DontRequireReceiver);
51.
}
52.
53.
//Increase health and inform other scripts about it
54.
public void IncreaseHealth(int amount){
55.
//Do nothing if the player is already dead
Search WWH ::




Custom Search