12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- #if UNITY_EDITOR
- using System;
- using Object = UnityEngine.Object;
- namespace Animancer.Editor.Tools
- {
-
-
- [Serializable]
- internal class AnimancerSettingsTool : AnimancerToolsWindow.Tool
- {
-
-
- public override int DisplayOrder => int.MaxValue;
-
- public override string Name => "Settings";
-
- public override string Instructions => null;
-
- public override string HelpURL => Strings.DocsURLs.APIDocumentation + "." + nameof(Editor) + "/" + nameof(AnimancerSettings);
-
- [NonSerialized]
- private UnityEditor.Editor _SettingsEditor;
-
-
- public override void OnEnable(int index)
- {
- base.OnEnable(index);
- var settings = AnimancerSettings.Instance;
- if (settings != null)
- _SettingsEditor = UnityEditor.Editor.CreateEditor(settings);
- }
-
- public override void OnDisable()
- {
- base.OnDisable();
- Object.DestroyImmediate(_SettingsEditor);
- }
-
-
- public override void DoBodyGUI()
- {
- if (_SettingsEditor != null)
- _SettingsEditor.OnInspectorGUI();
- }
-
- }
- }
- #endif
|