public override void OnInspectorGUI() { base.OnInspectorGUI(); GUILayout.BeginVertical(); GUILayout.Space(8); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("打开动画编辑器", GUILayout.MinWidth(120))) { SpriteAnimationData gen = (SpriteAnimationData)target; if (gen.name != defaultSpriteAnimationName) { EditorUtility.DisplayDialog("提示", "请修改预设名" + defaultSpriteAnimationName + "再操作", "Ok"); } else { SpriteAnimationEditorPopup v = EditorWindow.GetWindow(typeof(SpriteAnimationEditorPopup), false, "动画编辑器") as SpriteAnimationEditorPopup; v.SetGenerator(gen); v.Show(); } } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); GUILayout.Space(8); }
public override void OnInspectorGUI() { base.OnInspectorGUI(); GUILayout.BeginVertical(); GUILayout.Space(8); GUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("打开动画编辑器", GUILayout.MinWidth(120))) { SpriteAnimationData gen = (SpriteAnimationData)target; SpriteAnimationEditorPopup v = EditorWindow.GetWindow(typeof(SpriteAnimationEditorPopup), false, "动画编辑器") as SpriteAnimationEditorPopup; v.SetGenerator(gen); v.Show(); } GUILayout.FlexibleSpace(); GUILayout.EndHorizontal(); EditorGUILayout.EndVertical(); GUILayout.Space(8); }