@@ -66,7 +66,7 @@ public override void OnInspectorGUI()
6666 }
6767
6868 EditorGUILayout . TextField ( "Table Variables" , new GUIStyle ( EditorStyles . boldLabel ) ) ;
69- PrintState ( _gle . TableState ) ;
69+ PrintState ( _gle . TableState , _gle . TableVariableDefinitions ) ;
7070
7171 if ( _gle . PlayerStates . Count == 0 ) {
7272 EditorGUILayout . HelpBox ( "No player states created." , MessageType . Info ) ;
@@ -80,21 +80,21 @@ public override void OnInspectorGUI()
8080 }
8181 if ( _playerVarFoldout [ playerId ] = EditorGUILayout . BeginFoldoutHeaderGroup ( _playerVarFoldout [ playerId ] , $ "Player { playerId } ") ) {
8282 EditorGUI . indentLevel ++ ;
83- PrintState ( _gle . PlayerStates [ playerId ] ) ;
83+
84+ if ( _gle . CurrentPlayerState == _gle . PlayerStates [ playerId ] ) {
85+ EditorGUILayout . HelpBox ( "Current Player" , MessageType . Info ) ;
86+ }
87+
88+ PrintState ( _gle . PlayerStates [ playerId ] , _gle . PlayerVariableDefinitions ) ;
8489 EditorGUI . indentLevel -- ;
8590 }
8691 EditorGUILayout . EndFoldoutHeaderGroup ( ) ;
8792 }
8893 }
8994
90- private void PrintState ( State state )
95+ private static void PrintState ( State state , IEnumerable < VariableDefinition > definitions )
9196 {
92-
93- if ( _gle . CurrentPlayerState == state ) {
94- EditorGUILayout . HelpBox ( "Current Player" , MessageType . Info ) ;
95- }
96-
97- foreach ( var varDef in _gle . PlayerVariableDefinitions ) {
97+ foreach ( var varDef in definitions ) {
9898 EditorGUILayout . LabelField ( varDef . Name , state . Get ( varDef . Id ) . ToString ( ) ) ;
9999 }
100100 }
0 commit comments