浏览代码

Handle Correct disable of features upon visibility change.

/feature-sceneview-toolbar-preferences
Thomas ICHÉ 4 年前
当前提交
9d0be7c8
共有 1 个文件被更改,包括 17 次插入3 次删除
  1. 20
      Editor/SceneViewToolbar.cs

20
Editor/SceneViewToolbar.cs


[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

正在加载...
取消
保存