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(){
|
||||
// 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);
|
||||
|
||||
Reference in New Issue
Block a user