Skip to content

Instantly share code, notes, and snippets.

@jawinn jawinn/mono_reset.cs
Last active Jul 14, 2016

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
You can’t perform that action at this time.