diff --git a/Editor.GUI.CLI/External/AIO.Graph/Window/GraphicWindow/EmptyGraphWindow.cs b/Editor.GUI.CLI/External/AIO.Graph/Window/GraphicWindow/EmptyGraphWindow.cs index 5aecbd67..c3b45b8c 100644 --- a/Editor.GUI.CLI/External/AIO.Graph/Window/GraphicWindow/EmptyGraphWindow.cs +++ b/Editor.GUI.CLI/External/AIO.Graph/Window/GraphicWindow/EmptyGraphWindow.cs @@ -11,6 +11,7 @@ namespace AIO.UEditor /// /// 自定义窗口基类 /// + [PreferBinarySerialization] public abstract partial class EmptyGraphWindow : EditorWindow { /// @@ -18,10 +19,7 @@ public abstract partial class EmptyGraphWindow : EditorWindow /// /// 宽 /// 高 - protected EmptyGraphWindow(float w = 800, float h = 600) - { - minSize = new Vector2(w, h); - } + protected EmptyGraphWindow(float w = 800, float h = 600) { minSize = new Vector2(w, h); } /// /// 当前窗口宽度 @@ -48,24 +46,14 @@ protected EmptyGraphWindow(float w = 800, float h = 600) /// public Rect ReliablePosition { get; private set; } - private void ModifierKeysChanged() - { - OnModifierKeysChanged(); - } + private void ModifierKeysChanged() { OnModifierKeysChanged(); } - private void ShowButton(Rect rect) - { - OnShowButton(rect); - } + private void ShowButton(Rect rect) { OnShowButton(rect); } /// /// 转化为信息字符串 /// - public sealed override string ToString() - { - return base.ToString(); - } - + public sealed override string ToString() { return base.ToString(); } /// /// 标记目标已改变 @@ -86,4 +74,4 @@ protected static void HasChanged(Object target) EditorSceneManager.MarkSceneDirty(component.gameObject.scene); } } -} \ No newline at end of file +} diff --git a/Editor.GUI.CLI/External/AIO.Plugins/PluginData.cs b/Editor.GUI.CLI/External/AIO.Plugins/PluginData.cs index def2797f..b60a2710 100644 --- a/Editor.GUI.CLI/External/AIO.Plugins/PluginData.cs +++ b/Editor.GUI.CLI/External/AIO.Plugins/PluginData.cs @@ -11,6 +11,7 @@ namespace AIO /// 插件信息 /// [CreateAssetMenu(menuName = "Plugins/AIO Data", fileName = nameof(PluginData))] + [PreferBinarySerialization] internal class PluginData : ScriptableObject { /// @@ -40,4 +41,4 @@ internal class PluginData : ScriptableObject } internal partial class Plugins { } -} \ No newline at end of file +} diff --git a/Editor.GUI.CLI/Window/CustomExecute/CustomExecute.cs b/Editor.GUI.CLI/Window/CustomExecute/CustomExecute.cs index 7d27d322..450adde4 100644 --- a/Editor.GUI.CLI/Window/CustomExecute/CustomExecute.cs +++ b/Editor.GUI.CLI/Window/CustomExecute/CustomExecute.cs @@ -26,14 +26,15 @@ namespace AIO.UEditor )] public class CustomExecute : GraphicWindow { - public enum ExecuterMode + public enum ExecutedMode { Dynamic, Static } - private static string _projectPath; - private ExecuterMode _mode = ExecuterMode.Dynamic; + private static string _projectPath; + + private ExecutedMode _mode = ExecutedMode.Dynamic; /// /// 项目路径(也即是 Application.dataPath 路径的末尾去掉了 Assets) @@ -100,13 +101,13 @@ protected override void OnActivation() protected override void OnDraw() { GUILayout.BeginHorizontal(); - if (GUILayout.Toggle(_mode == ExecuterMode.Dynamic, "Dynamic", GEStyle.LargeButtonLeft)) _mode = ExecuterMode.Dynamic; + if (GUILayout.Toggle(_mode == ExecutedMode.Dynamic, "Dynamic", GEStyle.LargeButtonLeft)) _mode = ExecutedMode.Dynamic; - if (GUILayout.Toggle(_mode == ExecuterMode.Static, "Static", GEStyle.LargeButtonRight)) _mode = ExecuterMode.Static; + if (GUILayout.Toggle(_mode == ExecutedMode.Static, "Static", GEStyle.LargeButtonRight)) _mode = ExecutedMode.Static; GUILayout.EndHorizontal(); - if (_mode == ExecuterMode.Dynamic) + if (_mode == ExecutedMode.Dynamic) DynamicGUI(); else StaticGUI(); @@ -233,22 +234,25 @@ private void StaticGUI() Entity = EditorGUILayout.ObjectField(Entity, typeof(GameObject), true) as GameObject; GUILayout.EndHorizontal(); - using (new EditorGUI.DisabledScope(Entity)) + using (new EditorGUI.DisabledScope(!Entity)) { GUILayout.BeginHorizontal(); GUILayout.Label("Target:", GUILayout.Width(60)); var content = Target ? EditorGUIUtility.ObjectContent(Target, Target.GetType()) : new GUIContent(""); if (GUILayout.Button(content, GEStyle.MiniPopup)) { - var gm = new GenericMenu(); - var components = Entity.GetComponents(); + var gm = new GenericMenu(); gm.AddItem(new GUIContent(""), !Target, () => { Target = null; }); - foreach (var component in components) + if (Entity) { - var component1 = component; - gm.AddItem(new GUIContent(component.GetType().FullName), Target == component, () => { Target = component1; }); + foreach (var component in Entity.GetComponents()) + { + var component1 = component; + gm.AddItem(EditorGUIUtility.TrTempContent(component.GetType().FullName), Target == component, () => { Target = component1; }); + } } + gm.ShowAsContext(); } @@ -302,13 +306,13 @@ private void StaticGUI() case "Boolean": _parameters[i].BoolValue = EditorGUILayout.Toggle(_parameters[i].BoolValue); break; - case "Vector2": + case nameof(Vector2): _parameters[i].Vector2Value = EditorGUILayout.Vector2Field("", _parameters[i].Vector2Value); break; - case "Vector3": + case nameof(Vector3): _parameters[i].Vector3Value = EditorGUILayout.Vector3Field("", _parameters[i].Vector3Value); break; - case "Color": + case nameof(Color): _parameters[i].ColorValue = EditorGUILayout.ColorField(_parameters[i].ColorValue); break; default: @@ -570,4 +574,4 @@ private MethodInfo Method #endregion } -} \ No newline at end of file +}