Last active
July 14, 2016 21:46
-
-
Save jawinn/a08ff5206feae934935d0c165b67e2ec to your computer and use it in GitHub Desktop.
MonoBehaviour.Reset() Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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