fix: changes to FSM state string to better account for local players

This commit is contained in:
Chris
2025-11-10 16:32:23 -05:00
parent 1a8c2fc601
commit d75946de65

View File

@@ -102,13 +102,18 @@ namespace Reset.Units{
private void DrawStateGizmo(){
// Get state from FSM
if (UnitIsLocal()) {
string stateString = "";
if (UnitIsNetworked() && UnitIsLocal()) {
graphStateAsString.Value = FSM.currentRootStateName;
stateString = graphStateAsString.Value.ToString();
} else {
stateString = FSM.currentRootStateName;
}
// Draw state gizmo, regardless of if local or not
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);
} catch (Exception e) {
Debug.LogError(e.Message);