Skip to content

Instantly share code, notes, and snippets.

@jawinn
Last active July 14, 2016 21:46
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
MonoBehaviour.Reset() Example
private int _jointHealth;
public int startingJointHealth = 2;
// The setter here helps by making sure our health never goes below zero.
private int JointHealth {
get { return _jointHealth; }
set { _jointHealth = Mathf.Max(value, 0); }
}
void Reset(){
JointHealth = startingJointHealth;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment