fix: changes to FSM state string to better account for local players
This commit is contained in:
@@ -102,13 +102,18 @@ namespace Reset.Units{
|
|||||||
|
|
||||||
private void DrawStateGizmo(){
|
private void DrawStateGizmo(){
|
||||||
// Get state from FSM
|
// Get state from FSM
|
||||||
if (UnitIsLocal()) {
|
|
||||||
|
string stateString = "";
|
||||||
|
if (UnitIsNetworked() && UnitIsLocal()) {
|
||||||
graphStateAsString.Value = FSM.currentRootStateName;
|
graphStateAsString.Value = FSM.currentRootStateName;
|
||||||
|
stateString = graphStateAsString.Value.ToString();
|
||||||
|
} else {
|
||||||
|
stateString = FSM.currentRootStateName;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw state gizmo, regardless of if local or not
|
// Draw state gizmo, regardless of if local or not
|
||||||
try {
|
try {
|
||||||
Draw.ingame.Label2D(transform.position + Vector3.up * 2.7f, graphStateAsString.Value.ToString(),
|
Draw.ingame.Label2D(transform.position + Vector3.up * 2.7f, stateString,
|
||||||
Color.red);
|
Color.red);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Debug.LogError(e.Message);
|
Debug.LogError(e.Message);
|
||||||
|
|||||||
Reference in New Issue
Block a user