Skip to content

Commit 3bca80e

Browse files
committed
debug: Add easy way to trigger switches for testing.
1 parent 5de52b2 commit 3bca80e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

VisualPinball.Engine.PinMAME.Unity/Editor/PinMameGamelogicEngineInspector.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,12 @@ public class PinMameGamelogicEngineInspector : UnityEditor.Editor
5252

5353
private bool _toggleDebug = true;
5454

55+
int _debugSwitchId;
56+
5557
private SerializedProperty _disableAudioProperty;
5658

59+
60+
5761
private void OnEnable()
5862
{
5963
_gle = (PinMameGamelogicEngine) target;
@@ -189,6 +193,17 @@ public override void OnInspectorGUI()
189193
serializedObject.ApplyModifiedProperties();
190194
}
191195

196+
EditorGUILayout.BeginHorizontal();
197+
_debugSwitchId = EditorGUILayout.IntField("Switch", _debugSwitchId);
198+
if (GUILayout.Button("ON")) {
199+
_gle.Switch(_debugSwitchId.ToString(), true);
200+
}
201+
if (GUILayout.Button("OFF")) {
202+
_gle.Switch(_debugSwitchId.ToString(), false);
203+
}
204+
205+
EditorGUILayout.EndHorizontal();
206+
192207
EditorGUI.indentLevel--;
193208
}
194209

0 commit comments

Comments
 (0)