|
|
|
|
|
|
[SettingsProvider] |
|
|
|
public static SettingsProvider GetPreferences() |
|
|
|
{ |
|
|
|
static void PreferenceItem(string label, string name) |
|
|
|
static void OnToggleAll(bool toggle) |
|
|
|
{ |
|
|
|
OnToggleLinkGameView(toggle); |
|
|
|
} |
|
|
|
|
|
|
|
static void OnToggleLinkGameView(bool toggle) |
|
|
|
{ |
|
|
|
if (!toggle) |
|
|
|
LinkGameView.Active = false; |
|
|
|
} |
|
|
|
|
|
|
|
static void PreferenceItem(string label, string name, Action<bool> onToggle = null) |
|
|
|
{ |
|
|
|
EditorGUI.BeginChangeCheck(); |
|
|
|
bool val = EditorGUILayout.Toggle(label, Get(name)); |
|
|
|
|
|
|
onToggle?.Invoke(val); |
|
|
|
SceneView.RepaintAll(); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
label = "Scene View", |
|
|
|
guiHandler = (searchContext) => |
|
|
|
{ |
|
|
|
PreferenceItem("Show Toolbar", "showToolbar"); |
|
|
|
PreferenceItem("Show Toolbar", "showToolbar", OnToggleAll); |
|
|
|
PreferenceItem("Link Game View", kShowLinkGameView); |
|
|
|
PreferenceItem("Link Game View", kShowLinkGameView, OnToggleLinkGameView); |
|
|
|
PreferenceItem("Point of View", kShowPOV); |
|
|
|
PreferenceItem("Check Window", kShowCheck); |
|
|
|
PreferenceItem("Comments Window", kShowComments); |
|
|
|
|
|
|
}; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
static class Contents |
|
|
|