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