public override void Start() { if (bStarted == false) { bStarted = true; // Find our model InitModel(); lastStateSelect = Chr.STATESELECT.IDLE; v3BasePosition = goPortrait.transform.localPosition; v3RecoilDirection = Vector3.left; } }
//TODO:: Make this a state machine //Updates the character's state (SELECTED, TARGETTING, UNSELECTED) void cbUpdateStatus(Object target, params object[] args) { //Checks if character status has changed if (lastStateSelect != mod.stateSelect) { switch (mod.stateSelect) { //On switch to selection, highlight the border case Chr.STATESELECT.SELECTED: SetBorder("ChrBorderSelected"); break; case Chr.STATESELECT.TARGGETING: //If we need to despawn anything from the targetting process, we could do it here break; //On switch to unselected, make changes depending on previous state case Chr.STATESELECT.IDLE: if (lastStateSelect == Chr.STATESELECT.TARGGETING) { //Nothing needs to be done (currently, this may change) } else if (lastStateSelect == Chr.STATESELECT.SELECTED) { //Nothing needs to be done (currently, this may change) } //Then unhighlight the border SetBorder("ChrBorder"); break; //Catches unrecognized character states default: Debug.LogError("UNRECOGNIZED VIEW CHR SELECT STATE!"); return; } lastStateSelect = mod.stateSelect; } }