-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize component Normal version and Pro version are moved to different backend Editor more friendly Optimize memory Update example Simplify editor code
- Loading branch information
Showing
91 changed files
with
1,182 additions
and
1,106 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using UnityEditor; | ||
using UnityEditor.UIElements; | ||
using UnityEngine.UIElements; | ||
namespace Kurisu.GOAP.Editor | ||
{ | ||
public abstract class SetEditor : UnityEditor.Editor | ||
{ | ||
protected abstract string LabelText { get; } | ||
private const string ButtonText = "Open GOAP Editor"; | ||
public override VisualElement CreateInspectorGUI() | ||
{ | ||
var myInspector = new VisualElement(); | ||
myInspector.styleSheets.Add(UIUtility.GetInspectorStyleSheet()); | ||
myInspector.Add(UIUtility.GetLabel(LabelText, 20)); | ||
var description = new TextField(string.Empty); | ||
description.BindProperty(serializedObject.FindProperty("Description")); | ||
description.multiline = true; | ||
myInspector.Add(description); | ||
//Draw Button | ||
myInspector.Add(UIUtility.GetButton(ButtonText, UIUtility.AkiBlue, Open, 100)); | ||
return myInspector; | ||
} | ||
private void Open() | ||
{ | ||
GOAPEditorWindow.ShowEditorWindow(target as IGOAPSet); | ||
} | ||
} | ||
[CustomEditor(typeof(GOAPActionSet))] | ||
public class GOAPActionSetEditor : SetEditor | ||
{ | ||
protected override string LabelText => "AkiGOAP <size=12>V1.1.1</size> ActionSet"; | ||
} | ||
[CustomEditor(typeof(GOAPGoalSet))] | ||
public class GOAPGoalSetEditor : SetEditor | ||
{ | ||
protected override string LabelText => "AkiGOAP <size=12>V1.1.1</size> GoalSet"; | ||
} | ||
[CustomEditor(typeof(GOAPSet))] | ||
public class GOAPSetEditor : SetEditor | ||
{ | ||
protected override string LabelText => "AkiGOAP <size=12>V1.1.1</size> GOAPSet"; | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.