-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDebugOnlyProcessorEditor.cs
32 lines (23 loc) · 1.1 KB
/
DebugOnlyProcessorEditor.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using cmdwtf.UnityTools.Input;
using UnityEditor;
using UnityEngine;
using UnityEngine.InputSystem.Editor;
namespace cmdwtf.UnityTools.Editor
{
public class DebugOnlyProcessorEditor : InputParameterEditor<DebugOnlyProcessor>
{
private const string Prefix = "Allow In ";
private readonly GUIContent _inEditorContent = new GUIContent(Prefix + "Editor");
private readonly GUIContent _inDebugBuildContent = new GUIContent(Prefix + "Debug Build");
private readonly GUIContent _inReleaseBuildContent = new GUIContent(Prefix + "Release Build");
public override void OnGUI()
{
target._allowInReleaseBuild = EditorGUILayout.Toggle(_inReleaseBuildContent, target._allowInReleaseBuild);
GUITools.PushEnabled(!target._allowInReleaseBuild);
target._allowInDebugBuild = EditorGUILayout.Toggle(_inDebugBuildContent, target._allowInDebugBuild || target._allowInReleaseBuild);
GUI.enabled = !target._allowInDebugBuild;
target._allowInEditor = EditorGUILayout.Toggle(_inEditorContent, target._allowInEditor || target._allowInDebugBuild);
GUITools.PopEnabled();
}
}
}