├── .gitignore ├── .idea ├── .idea.BehaviorTreeEditor │ └── .idea │ │ ├── .gitignore │ │ ├── encodings.xml │ │ ├── indexLayout.xml │ │ └── vcs.xml └── .idea.BehaviourTreeEditor │ └── .idea │ ├── .gitignore │ ├── encodings.xml │ ├── indexLayout.xml │ └── vcs.xml ├── Assets ├── BTCore.meta ├── BTCore │ ├── Data.meta │ ├── Data │ │ ├── TestBothAbort.json │ │ ├── TestBothAbort.json.meta │ │ ├── TestExternalNode.json │ │ ├── TestExternalNode.json.meta │ │ ├── TestGroupStickNoteComment.json │ │ ├── TestGroupStickNoteComment.json.meta │ │ ├── TestLowerPriorityAbort.json │ │ ├── TestLowerPriorityAbort.json.meta │ │ ├── TestRandom.json │ │ ├── TestRandom.json.meta │ │ ├── TestSelfAbort.json │ │ └── TestSelfAbort.json.meta │ ├── Editor.meta │ ├── Editor │ │ ├── BTEditor.asmdef │ │ ├── BTEditor.asmdef.meta │ │ ├── BTEditorDef.cs │ │ ├── BTEditorDef.cs.meta │ │ ├── BTEditorWindow.cs │ │ ├── BTEditorWindow.cs.meta │ │ ├── BTNodeView.cs │ │ ├── BTNodeView.cs.meta │ │ ├── BTUndoRedo.cs │ │ ├── BTUndoRedo.cs.meta │ │ ├── BTView.cs │ │ ├── BTView.cs.meta │ │ ├── BlackboardView.cs │ │ ├── BlackboardView.cs.meta │ │ ├── ColorGroup.cs │ │ ├── ColorGroup.cs.meta │ │ ├── DoubleClickNode.cs │ │ ├── DoubleClickNode.cs.meta │ │ ├── IDataSerializable.cs │ │ ├── IDataSerializable.cs.meta │ │ ├── Inspectors.meta │ │ ├── Inspectors │ │ │ ├── Actions.meta │ │ │ ├── Actions │ │ │ │ ├── LogInspector.cs │ │ │ │ ├── LogInspector.cs.meta │ │ │ │ ├── WaitInspector.cs │ │ │ │ └── WaitInspector.cs.meta │ │ │ ├── BTNodeInspector.cs │ │ │ ├── BTNodeInspector.cs.meta │ │ │ ├── BlackboardInspector.cs │ │ │ ├── BlackboardInspector.cs.meta │ │ │ ├── BlackboardValueInspector.cs │ │ │ ├── BlackboardValueInspector.cs.meta │ │ │ ├── Composites.meta │ │ │ ├── Composites │ │ │ │ ├── CompositeInspector.cs │ │ │ │ ├── CompositeInspector.cs.meta │ │ │ │ ├── RandomSelectorInspector.cs │ │ │ │ ├── RandomSelectorInspector.cs.meta │ │ │ │ ├── RandomSequenceInspector.cs │ │ │ │ ├── RandomSequenceInspector.cs.meta │ │ │ │ ├── SelectorInspector.cs │ │ │ │ ├── SelectorInspector.cs.meta │ │ │ │ ├── SequenceInspector.cs │ │ │ │ └── SequenceInspector.cs.meta │ │ │ ├── Conditions.meta │ │ │ ├── Conditions │ │ │ │ ├── IsKeyDownInspector.cs │ │ │ │ ├── IsKeyDownInspector.cs.meta │ │ │ │ ├── ProbabilityInspector.cs │ │ │ │ └── ProbabilityInspector.cs.meta │ │ │ ├── Decorators.meta │ │ │ ├── Decorators │ │ │ │ ├── RepeaterInspector.cs │ │ │ │ └── RepeaterInspector.cs.meta │ │ │ ├── Externals.meta │ │ │ ├── Externals │ │ │ │ ├── ExternalActionInspector.cs │ │ │ │ ├── ExternalActionInspector.cs.meta │ │ │ │ ├── ExternalConditionInspector.cs │ │ │ │ ├── ExternalConditionInspector.cs.meta │ │ │ │ ├── ExternalNodeInspector.cs │ │ │ │ └── ExternalNodeInspector.cs.meta │ │ │ ├── InspectorBase.cs │ │ │ ├── InspectorBase.cs.meta │ │ │ ├── MonoBehaviours.meta │ │ │ ├── MonoBehaviours │ │ │ │ ├── BehaviorTreeInspector.cs │ │ │ │ └── BehaviorTreeInspector.cs.meta │ │ │ ├── SharedValueInspector.cs │ │ │ └── SharedValueInspector.cs.meta │ │ ├── NodeInspectorView.cs │ │ ├── NodeInspectorView.cs.meta │ │ ├── NodePort.cs │ │ ├── NodePort.cs.meta │ │ ├── NodeSearchWindow.cs │ │ ├── NodeSearchWindow.cs.meta │ │ ├── Resources.meta │ │ ├── Resources │ │ │ ├── ConditionalAbortBothIcon.png │ │ │ ├── ConditionalAbortBothIcon.png.meta │ │ │ ├── ConditionalAbortLowerPriorityIcon.png │ │ │ ├── ConditionalAbortLowerPriorityIcon.png.meta │ │ │ ├── ConditionalAbortSelfIcon.png │ │ │ └── ConditionalAbortSelfIcon.png.meta │ │ ├── SplitView.cs │ │ ├── SplitView.cs.meta │ │ ├── UIBuilder.meta │ │ └── UIBuilder │ │ │ ├── BTEditorWindow.uxml │ │ │ ├── BTEditorWindow.uxml.meta │ │ │ ├── BTEditorWindowStyle.uss │ │ │ ├── BTEditorWindowStyle.uss.meta │ │ │ ├── BTNodeView.uxml │ │ │ ├── BTNodeView.uxml.meta │ │ │ ├── BTNodeViewStyle.uss │ │ │ ├── BTNodeViewStyle.uss.meta │ │ │ ├── BTViewStyle.uss │ │ │ └── BTViewStyle.uss.meta │ ├── Runtime.Unity.meta │ ├── Runtime.Unity │ │ ├── BTRuntime.Unity.asmdef │ │ ├── BTRuntime.Unity.asmdef.meta │ │ ├── BehaviorTree.cs │ │ ├── BehaviorTree.cs.meta │ │ ├── Conditions.meta │ │ └── Conditions │ │ │ ├── IsKeyDown.cs │ │ │ └── IsKeyDown.cs.meta │ ├── Runtime.meta │ └── Runtime │ │ ├── Actions.meta │ │ ├── Actions │ │ ├── Action.cs │ │ ├── Action.cs.meta │ │ ├── Log.cs │ │ ├── Log.cs.meta │ │ ├── Wait.cs │ │ └── Wait.cs.meta │ │ ├── Attributes.meta │ │ ├── Attributes │ │ ├── NodeInspectorAttribute.cs │ │ └── NodeInspectorAttribute.cs.meta │ │ ├── BTData.cs │ │ ├── BTData.cs.meta │ │ ├── BTDef.cs │ │ ├── BTDef.cs.meta │ │ ├── BTEx.cs │ │ ├── BTEx.cs.meta │ │ ├── BTLogger.cs │ │ ├── BTLogger.cs.meta │ │ ├── BTNode.cs │ │ ├── BTNode.cs.meta │ │ ├── BTRuntime.asmdef │ │ ├── BTRuntime.asmdef.meta │ │ ├── BTSettings.cs │ │ ├── BTSettings.cs.meta │ │ ├── BTree.cs │ │ ├── BTree.cs.meta │ │ ├── Blackboards.meta │ │ ├── Blackboards │ │ ├── Blackboard.cs │ │ ├── Blackboard.cs.meta │ │ ├── BlackboardValue.cs │ │ ├── BlackboardValue.cs.meta │ │ ├── PresetBlackboardValue.cs │ │ └── PresetBlackboardValue.cs.meta │ │ ├── Composites.meta │ │ ├── Composites │ │ ├── Composite.cs │ │ ├── Composite.cs.meta │ │ ├── Parallel.cs │ │ ├── Parallel.cs.meta │ │ ├── RandomSelector.cs │ │ ├── RandomSelector.cs.meta │ │ ├── RandomSequence.cs │ │ ├── RandomSequence.cs.meta │ │ ├── Selector.cs │ │ ├── Selector.cs.meta │ │ ├── Sequence.cs │ │ └── Sequence.cs.meta │ │ ├── Conditions.meta │ │ ├── Conditions │ │ ├── Condition.cs │ │ ├── Condition.cs.meta │ │ ├── RandomProbability.cs │ │ └── RandomProbability.cs.meta │ │ ├── Decorators.meta │ │ ├── Decorators │ │ ├── Decorator.cs │ │ ├── Decorator.cs.meta │ │ ├── Failure.cs │ │ ├── Failure.cs.meta │ │ ├── Inverter.cs │ │ ├── Inverter.cs.meta │ │ ├── Repeater.cs │ │ ├── Repeater.cs.meta │ │ ├── Success.cs │ │ ├── Success.cs.meta │ │ ├── UntilSuccess.cs │ │ └── UntilSuccess.cs.meta │ │ ├── EntryNode.cs │ │ ├── EntryNode.cs.meta │ │ ├── Externals.meta │ │ ├── Externals │ │ ├── ExternalAction.cs │ │ ├── ExternalAction.cs.meta │ │ ├── ExternalCondition.cs │ │ ├── ExternalCondition.cs.meta │ │ ├── IExternalNode.cs │ │ └── IExternalNode.cs.meta │ │ ├── INode.cs │ │ ├── INode.cs.meta │ │ ├── OtherNodes.meta │ │ ├── OtherNodes │ │ ├── GroupNode.cs │ │ ├── GroupNode.cs.meta │ │ ├── StickNoteNode.cs │ │ └── StickNoteNode.cs.meta │ │ ├── ParentNode.cs │ │ ├── ParentNode.cs.meta │ │ ├── SharedValue.cs │ │ └── SharedValue.cs.meta ├── Examples.meta ├── Examples │ ├── AbortType.meta │ ├── AbortType │ │ ├── ActionAttack.cs │ │ ├── ActionAttack.cs.meta │ │ ├── ActionSkill.cs │ │ ├── ActionSkill.cs.meta │ │ ├── ActionWait.cs │ │ ├── ActionWait.cs.meta │ │ ├── ActionWork.cs │ │ ├── ActionWork.cs.meta │ │ ├── ConditionHP.cs │ │ ├── ConditionHP.cs.meta │ │ ├── ConditionMP.cs │ │ └── ConditionMP.cs.meta │ ├── ExternalNode.meta │ └── ExternalNode │ │ ├── AIAgent.cs │ │ ├── AIAgent.cs.meta │ │ ├── AIService.cs │ │ ├── AIService.cs.meta │ │ ├── ExternalNodeTree.cs │ │ ├── ExternalNodeTree.cs.meta │ │ ├── MyAction.cs │ │ ├── MyAction.cs.meta │ │ ├── MyCondition.cs │ │ └── MyCondition.cs.meta ├── Plugins.meta ├── Plugins │ ├── Sirenix.meta │ └── Sirenix │ │ ├── Assemblies.meta │ │ ├── Assemblies │ │ ├── NoEditor.meta │ │ ├── NoEditor │ │ │ ├── Sirenix.Serialization.dll │ │ │ ├── Sirenix.Serialization.dll.meta │ │ │ ├── Sirenix.Utilities.dll │ │ │ └── Sirenix.Utilities.dll.meta │ │ ├── NoEmitAndNoEditor.meta │ │ ├── NoEmitAndNoEditor │ │ │ ├── Sirenix.Serialization.dll │ │ │ ├── Sirenix.Serialization.dll.meta │ │ │ ├── Sirenix.Utilities.dll │ │ │ └── Sirenix.Utilities.dll.meta │ │ ├── Sirenix.OdinInspector.Attributes.dll │ │ ├── Sirenix.OdinInspector.Attributes.dll.meta │ │ ├── Sirenix.OdinInspector.Attributes.xml │ │ ├── Sirenix.OdinInspector.Attributes.xml.meta │ │ ├── Sirenix.OdinInspector.Editor.dll │ │ ├── Sirenix.OdinInspector.Editor.dll.meta │ │ ├── Sirenix.OdinInspector.Editor.xml │ │ ├── Sirenix.OdinInspector.Editor.xml.meta │ │ ├── Sirenix.OdinValidator.Editor.dll │ │ ├── Sirenix.OdinValidator.Editor.dll.meta │ │ ├── Sirenix.OdinValidator.Editor.xml │ │ ├── Sirenix.OdinValidator.Editor.xml.meta │ │ ├── Sirenix.Serialization.Config.dll │ │ ├── Sirenix.Serialization.Config.dll.meta │ │ ├── Sirenix.Serialization.Config.xml │ │ ├── Sirenix.Serialization.Config.xml.meta │ │ ├── Sirenix.Serialization.dll │ │ ├── Sirenix.Serialization.dll.meta │ │ ├── Sirenix.Serialization.xml │ │ ├── Sirenix.Serialization.xml.meta │ │ ├── Sirenix.Utilities.Editor.dll │ │ ├── Sirenix.Utilities.Editor.dll.meta │ │ ├── Sirenix.Utilities.Editor.xml │ │ ├── Sirenix.Utilities.Editor.xml.meta │ │ ├── Sirenix.Utilities.dll │ │ ├── Sirenix.Utilities.dll.meta │ │ ├── Sirenix.Utilities.xml │ │ ├── Sirenix.Utilities.xml.meta │ │ ├── link.xml │ │ └── link.xml.meta │ │ ├── Demos.meta │ │ ├── Odin Inspector.meta │ │ ├── Odin Inspector │ │ ├── Assets.meta │ │ ├── Assets │ │ │ ├── Editor.meta │ │ │ └── Editor │ │ │ │ ├── Bootstrap License.txt │ │ │ │ ├── Bootstrap License.txt.meta │ │ │ │ ├── ConfigData.bytes │ │ │ │ ├── ConfigData.bytes.meta │ │ │ │ ├── OdinPathLookup.asset │ │ │ │ ├── OdinPathLookup.asset.meta │ │ │ │ ├── SdfIconAtlas.png │ │ │ │ └── SdfIconAtlas.png.meta │ │ ├── Config.meta │ │ ├── Config │ │ │ ├── Editor.meta │ │ │ ├── Editor │ │ │ │ ├── GeneralDrawerConfig.asset │ │ │ │ ├── GeneralDrawerConfig.asset.meta │ │ │ │ ├── InspectorConfig.asset │ │ │ │ ├── InspectorConfig.asset.meta │ │ │ │ ├── OdinModuleConfig.asset │ │ │ │ └── OdinModuleConfig.asset.meta │ │ │ ├── Resources.meta │ │ │ └── Resources │ │ │ │ ├── Sirenix.meta │ │ │ │ └── Sirenix │ │ │ │ ├── GlobalSerializationConfig.asset │ │ │ │ └── GlobalSerializationConfig.asset.meta │ │ ├── Modules.meta │ │ └── Modules │ │ │ ├── Unity.Entities.data │ │ │ ├── Unity.Entities.data.meta │ │ │ ├── Unity.Localization.data │ │ │ ├── Unity.Localization.data.meta │ │ │ ├── Unity.Mathematics.data │ │ │ └── Unity.Mathematics.data.meta │ │ ├── Odin Validator.meta │ │ ├── Odin Validator │ │ ├── Editor.meta │ │ ├── Editor │ │ │ ├── Config.meta │ │ │ ├── Config │ │ │ │ ├── AutomationConfig.asset │ │ │ │ ├── AutomationConfig.asset.meta │ │ │ │ ├── GlobalValidationConfig.asset │ │ │ │ ├── GlobalValidationConfig.asset.meta │ │ │ │ ├── RuleConfig.asset │ │ │ │ └── RuleConfig.asset.meta │ │ │ ├── Profiles.meta │ │ │ └── Profiles │ │ │ │ ├── Main Profile.asset │ │ │ │ └── Main Profile.asset.meta │ │ ├── EnsureCorrectOdinVersion.cs │ │ ├── EnsureCorrectOdinVersion.cs.meta │ │ ├── Readme.txt │ │ └── Readme.txt.meta │ │ ├── Readme.txt │ │ └── Readme.txt.meta ├── Scenes.meta └── Scenes │ ├── 1. Start.unity │ ├── 1. Start.unity.meta │ ├── 2. ExternalNode.unity │ └── 2. ExternalNode.unity.meta ├── Images ├── 1.png ├── 2.png ├── 3.png ├── LowerPriorityAbort.gif └── StickNoteAndGroup.png ├── LICENSE ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── AutoStreamingSettings.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── MemorySettings.asset ├── NavMeshAreas.asset ├── PackageManagerSettings.asset ├── Packages │ └── com.unity.testtools.codecoverage │ │ └── Settings.json ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── SceneTemplateSettings.json ├── TagManager.asset ├── TimeManager.asset ├── TimelineSettings.asset ├── UnityConnectSettings.asset ├── VFXManager.asset ├── VersionControlSettings.asset ├── XRSettings.asset └── boot.config ├── README.md └── UIElementsSchema ├── UIElements.xsd ├── Unity.Cloud.Collaborate.Components.ChangeListEntries.xsd ├── Unity.Cloud.Collaborate.Components.xsd ├── Unity.Cloud.Collaborate.Views.xsd ├── Unity.Profiling.Editor.xsd ├── Unity.UI.Builder.xsd ├── UnityEditor.Experimental.GraphView.xsd ├── UnityEditor.Overlays.xsd ├── UnityEditor.PackageManager.UI.Internal.xsd ├── UnityEditor.Search.xsd ├── UnityEditor.ShortcutManagement.xsd ├── UnityEditor.UIElements.Debugger.xsd ├── UnityEditor.UIElements.xsd └── UnityEngine.UIElements.xsd /.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/main/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Uu]ser[Ss]ettings/ 12 | 13 | # MemoryCaptures can get excessive in size. 14 | # They also could contain extremely sensitive data 15 | /[Mm]emoryCaptures/ 16 | 17 | # Recordings can get excessive in size 18 | /[Rr]ecordings/ 19 | 20 | # Uncomment this line if you wish to ignore the asset store tools plugin 21 | # /[Aa]ssets/AssetStoreTools* 22 | 23 | # Autogenerated Jetbrains Rider plugin 24 | /[Aa]ssets/Plugins/Editor/JetBrains* 25 | 26 | # Visual Studio cache directory 27 | .vs/ 28 | 29 | # Gradle cache directory 30 | .gradle/ 31 | 32 | # Autogenerated VS/MD/Consulo solution and project files 33 | ExportedObj/ 34 | .consulo/ 35 | *.csproj 36 | *.unityproj 37 | *.sln 38 | *.suo 39 | *.tmp 40 | *.user 41 | *.userprefs 42 | *.pidb 43 | *.booproj 44 | *.svd 45 | *.pdb 46 | *.mdb 47 | *.opendb 48 | *.VC.db 49 | 50 | # Unity3D generated meta files 51 | *.pidb.meta 52 | *.pdb.meta 53 | *.mdb.meta 54 | 55 | # Unity3D generated file on crash reports 56 | sysinfo.txt 57 | 58 | # Builds 59 | *.apk 60 | *.aab 61 | *.unitypackage 62 | *.app 63 | 64 | # Crashlytics generated file 65 | crashlytics-build.properties 66 | 67 | # Packed Addressables 68 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 69 | 70 | # Temporary auto-generated Android Assets 71 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 72 | /[Aa]ssets/[Ss]treamingAssets/aa/* -------------------------------------------------------------------------------- /.idea/.idea.BehaviorTreeEditor/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Rider ignored files 5 | /modules.xml 6 | /contentModel.xml 7 | /.idea.BehaviorTreeEditor.iml 8 | /projectSettingsUpdater.xml 9 | # Editor-based HTTP Client requests 10 | /httpRequests/ 11 | # Datasource local storage ignored files 12 | /dataSources/ 13 | /dataSources.local.xml 14 | -------------------------------------------------------------------------------- /.idea/.idea.BehaviorTreeEditor/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/.idea.BehaviorTreeEditor/.idea/indexLayout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/.idea.BehaviorTreeEditor/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/.idea.BehaviourTreeEditor/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Rider ignored files 5 | /.idea.BehaviourTreeEditor.iml 6 | /modules.xml 7 | /projectSettingsUpdater.xml 8 | /contentModel.xml 9 | # Editor-based HTTP Client requests 10 | /httpRequests/ 11 | # Datasource local storage ignored files 12 | /dataSources/ 13 | /dataSources.local.xml 14 | -------------------------------------------------------------------------------- /.idea/.idea.BehaviourTreeEditor/.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /.idea/.idea.BehaviourTreeEditor/.idea/indexLayout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/.idea.BehaviourTreeEditor/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Assets/BTCore.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d4f1dd9bca25ac4693f7d4f2fe5f562 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BTCore/Data.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e1758633035e05e4e9c3aed4746fd117 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BTCore/Data/TestBothAbort.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71f30aa9d941a724c8c871f8e96b6dbe 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/BTCore/Data/TestExternalNode.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 179217fab82e14f458be98215972af99 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/BTCore/Data/TestGroupStickNoteComment.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fbd9873839ee74f478f2c41b4857a70b 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/BTCore/Data/TestLowerPriorityAbort.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00f57fc231ebdb148a581b7632f9622a 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/BTCore/Data/TestRandom.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03fd2db1d4bde27408568c1a638ff948 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/BTCore/Data/TestSelfAbort.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9bb5a608e2d29f41a34eb5f96df8e60 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/BTCore/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d27051b377de6f4098a8be06e2bf625 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BTCore/Editor/BTEditor.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "BTEditor", 3 | "rootNamespace": "", 4 | "references": [ 5 | "GUID:16a6c8a30b87ea844a4b0c5eb1fa6caa", 6 | "GUID:2288bc6750e10134db421a698fc0b82c" 7 | ], 8 | "includePlatforms": [ 9 | "Editor" 10 | ], 11 | "excludePlatforms": [], 12 | "allowUnsafeCode": false, 13 | "overrideReferences": false, 14 | "precompiledReferences": [], 15 | "autoReferenced": true, 16 | "defineConstraints": [], 17 | "versionDefines": [], 18 | "noEngineReferences": false 19 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/BTEditor.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5c18754c71f35e14abdcff74889c3a0c 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/BTCore/Editor/BTEditorDef.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: BTEditorDef.cs 3 | // Brief: BTEditorDef 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2023-09-29 8 | //============================================================ 9 | 10 | using System.Reflection; 11 | using Newtonsoft.Json; 12 | 13 | namespace BTCore.Editor 14 | { 15 | public static class BTEditorDef 16 | { 17 | // BT窗口结构文件路径 18 | public static readonly string BTEditorWindowUxmlPath = "Assets/BTCore/Editor/UIBuilder/BTEditorWindow.uxml"; 19 | // BT节点结构文件路径 20 | public static readonly string BTNodeViewUxmlPath = "Assets/BTCore/Editor/UIBuilder/BTNodeView.uxml"; 21 | // 树形窗口视图样式路径 22 | public static readonly string BTViewStylePath = "Assets/BTCore/Editor/UIBuilder/BTViewStyle.uss"; 23 | 24 | // 存放序列化后的BT数据目录 25 | public static readonly string DataDir = "Assets/BTCore/Data"; 26 | // 默认保存BT文件名称 27 | public static readonly string DefaultFileName = "NewBT.json"; 28 | // 对应BT数据序列化保存文件后缀 29 | public static readonly string DataExt = "json"; 30 | 31 | public static BindingFlags BindValueFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Assets/BTCore/Editor/BTEditorDef.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45cf50df32c7466e8dda41c9b9511beb 3 | timeCreated: 1695976518 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/BTEditorWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 59dededf5d711244e8815eab56a80681 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BTCore/Editor/BTNodeView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1dea7fb7187a4af5a74e9c7f4df0913a 3 | timeCreated: 1696492912 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/BTUndoRedo.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 223f67daee8c4d31b0064987a57788ed 3 | timeCreated: 1697348219 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/BTView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a6b2a182d99342029e01f737889f9ceb 3 | timeCreated: 1696238174 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/BlackboardView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f805d6f45974628bfd5ae43314900fe 3 | timeCreated: 1696774943 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/ColorGroup.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: ColorGroup.cs 3 | // Brief: ColorGroup 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2024-06-27 8 | //============================================================ 9 | 10 | using UnityEditor.UIElements; 11 | using UnityEngine; 12 | using UnityEngine.UIElements; 13 | using Group = UnityEditor.Experimental.GraphView.Group; 14 | 15 | namespace BTCore.Editor 16 | { 17 | public class ColorGroup : Group 18 | { 19 | public ColorGroup() { 20 | var colorField = new ColorField() { value = new Color(0.7f, 0.8f, 0.7f) }; 21 | colorField.RegisterValueChangedCallback(evt => ApplyColor(evt.newValue)); 22 | colorField.style.width = 50; 23 | colorField.style.height = 20; 24 | headerContainer.Add(colorField); 25 | ApplyColor(colorField.value); 26 | } 27 | 28 | private void ApplyColor(Color color) { 29 | style.backgroundColor = new StyleColor(new Color(color.r, color.g, color.b, 0.3f)); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/ColorGroup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45251abe6d1e460eb6fcdbad618c7f6f 3 | timeCreated: 1719469670 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/DoubleClickNode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 526b610df79c459d8d7451745f872dba 3 | timeCreated: 1719629062 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/IDataSerializable.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: IDataSerializable.cs 3 | // Brief: IDataSerializable 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2023-03-24 8 | //============================================================ 9 | 10 | namespace BTCore.Editor 11 | { 12 | public interface IDataSerializable 13 | { 14 | void ImportData(T data); 15 | 16 | T ExportData(); 17 | } 18 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/IDataSerializable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b97924b3b5eec0e4f83fcc38f064ed30 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 284a0c717cb64100a58b2810890dc0a7 3 | timeCreated: 1696738782 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Actions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e22db08c78a54cc295a185d105f07ea7 3 | timeCreated: 1696759561 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Actions/LogInspector.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: LogInspector.cs 3 | // Brief: LogInspector 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2023-10-08 8 | //============================================================ 9 | 10 | using BTCore.Runtime; 11 | using BTCore.Runtime.Actions; 12 | using BTCore.Runtime.Attributes; 13 | using Sirenix.OdinInspector; 14 | 15 | namespace BTCore.Editor.Inspectors.Actions 16 | { 17 | [NodeInspector(typeof(Log))] 18 | public class LogInspector : BTNodeInspector 19 | { 20 | [ShowInInspector] 21 | [LabelText("Log")] 22 | [LabelWidth(100)] 23 | [OnValueChanged("OnFieldValueChanged")] 24 | private SharedValueInspector _message = new SharedValueInspector(); 25 | 26 | private Log _logData; 27 | 28 | protected override void OnImportData(Log data) { 29 | _logData = data; 30 | _message.ImportData(data.Message); 31 | } 32 | 33 | public override BTNode ExportData() { 34 | return _logData; 35 | } 36 | 37 | protected override void OnFieldValueChanged() { 38 | _logData.Message = _message.ExportData(); 39 | base.OnFieldValueChanged(); 40 | } 41 | 42 | public override void Reset() { 43 | _message = new SharedValueInspector(); 44 | _logData = null; 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Actions/LogInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2fbdde5fd04545128c97684e4f1fb963 3 | timeCreated: 1696738954 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Actions/WaitInspector.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: WaitInspector.cs 3 | // Brief: WaitInspector 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2023-10-08 8 | //============================================================ 9 | 10 | 11 | using BTCore.Runtime; 12 | using BTCore.Runtime.Actions; 13 | using BTCore.Runtime.Attributes; 14 | using Sirenix.OdinInspector; 15 | 16 | namespace BTCore.Editor.Inspectors.Actions 17 | { 18 | [NodeInspector(typeof(Wait))] 19 | public class WaitInspector : BTNodeInspector 20 | { 21 | [ShowInInspector] 22 | [LabelText("Duration(ms)")] 23 | [LabelWidth(100)] 24 | [OnValueChanged("OnFieldValueChanged")] 25 | private int _duration; 26 | 27 | private Wait _waitData; 28 | 29 | protected override void OnImportData(Wait data) { 30 | _waitData = data; 31 | _duration = data.Duration; 32 | } 33 | 34 | public override BTNode ExportData() { 35 | return _waitData; 36 | } 37 | 38 | protected override void OnFieldValueChanged() { 39 | _waitData.Duration = _duration; 40 | base.OnFieldValueChanged(); 41 | } 42 | 43 | public override void Reset() { 44 | _duration = 0; 45 | _waitData = null; 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Actions/WaitInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71cfc68edfed4246bbd243d4ffb90999 3 | timeCreated: 1696739966 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/BTNodeInspector.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: BTNodeInspector.cs 3 | // Brief: BTNodeInspector 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2023-10-08 8 | //============================================================ 9 | 10 | using System; 11 | using BTCore.Runtime; 12 | using Sirenix.OdinInspector; 13 | using UnityEngine; 14 | 15 | namespace BTCore.Editor.Inspectors 16 | { 17 | public abstract class BTNodeInspector : InspectorBase, IDataSerializable 18 | { 19 | [HideInInspector] 20 | public Action OnNodeViewUpdate; 21 | 22 | [TextArea] 23 | [OnValueChanged("OnFieldValueChanged")] 24 | public string Comment; 25 | 26 | public abstract void ImportData(BTNode data); 27 | public abstract BTNode ExportData(); 28 | 29 | public void OnBlackboardValueChanged() { 30 | foreach (var fieldInfo in GetType().GetFields(BTEditorDef.BindValueFlags)) { 31 | if (fieldInfo.FieldType.IsSubclassOf(typeof(SharedValueInspector))) { 32 | var svInspector = fieldInfo.GetValue(this) as SharedValueInspector; 33 | svInspector?.RebindValueName(); 34 | } 35 | } 36 | } 37 | } 38 | 39 | public abstract class BTNodeInspector : BTNodeInspector where T : BTNode 40 | { 41 | private BTNode _btNode; 42 | 43 | public override void ImportData(BTNode data) { 44 | _btNode = data; 45 | Comment = data.Comment; 46 | OnImportData(data as T); 47 | } 48 | 49 | protected abstract void OnImportData(T data); 50 | 51 | // 字段数值变化后,可能需要刷新下对应NodeView的显示,这个应放到最后调用 52 | protected override void OnFieldValueChanged() { 53 | _btNode.Comment = Comment; 54 | OnNodeViewUpdate?.Invoke(); 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/BTNodeInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70ca7aaef464441bbb387fdbe5b9538e 3 | timeCreated: 1696738833 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/BlackboardInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 495034841575400caa858adc7659703a 3 | timeCreated: 1696842825 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/BlackboardValueInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a6c66794a3105b84abf73fca27f2dfd1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Composites.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 42524897b7c143729d5531bf7ef1c488 3 | timeCreated: 1718788622 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Composites/CompositeInspector.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: CompositeInspector.cs 3 | // Brief: CompositeInspector 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2024-06-19 8 | //============================================================ 9 | 10 | using BTCore.Runtime; 11 | using Sirenix.OdinInspector; 12 | 13 | namespace BTCore.Editor.Inspectors.Composites 14 | { 15 | public abstract class CompositeInspector : BTNodeInspector where T : BTNode 16 | { 17 | [ShowInInspector] 18 | [LabelText("中断类型")] 19 | [LabelWidth(100)] 20 | [OnValueChanged("OnFieldValueChanged")] 21 | protected AbortType AbortType = AbortType.None; 22 | } 23 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Composites/CompositeInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 33f8ef54f78e4dcab87a584d013bcaf5 3 | timeCreated: 1718789064 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Composites/RandomSelectorInspector.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: RandomSelectorInspector.cs 3 | // Brief: RandomSelectorInspector 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2024-07-05 8 | //============================================================ 9 | 10 | using BTCore.Runtime; 11 | using BTCore.Runtime.Attributes; 12 | using BTCore.Runtime.Composites; 13 | using Sirenix.OdinInspector; 14 | 15 | namespace BTCore.Editor.Inspectors.Composites 16 | { 17 | [NodeInspector(typeof(RandomSelector))] 18 | public class RandomSelectorInspector : CompositeInspector 19 | { 20 | [ShowInInspector] 21 | [HorizontalGroup] 22 | [LabelText("Use Seed:")] 23 | [LabelWidth(100)] 24 | [OnValueChanged("OnFieldValueChanged")] 25 | private bool _useSeed; 26 | 27 | [ShowInInspector] 28 | [HorizontalGroup] 29 | [LabelText("Seed:")] 30 | [LabelWidth(40)] 31 | [ShowIf("_useSeed")] 32 | [OnValueChanged("OnFieldValueChanged")] 33 | private int _seed; 34 | 35 | private RandomSelector _selector; 36 | 37 | 38 | public override BTNode ExportData() { 39 | return _selector; 40 | } 41 | 42 | protected override void OnFieldValueChanged() { 43 | _selector.Seed = _seed; 44 | _selector.UseSeed = _useSeed; 45 | base.OnFieldValueChanged(); 46 | } 47 | 48 | protected override void OnImportData(RandomSelector data) { 49 | _selector = data; 50 | _seed = data.Seed; 51 | _useSeed = data.UseSeed; 52 | } 53 | 54 | public override void Reset() { 55 | _selector = null; 56 | AbortType = AbortType.None; 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Composites/RandomSelectorInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98691c123a244076983bdb742effa26d 3 | timeCreated: 1720112957 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Composites/RandomSequenceInspector.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: RandomSequenceInspector.cs 3 | // Brief: RandomSequenceInspector 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2024-07-04 8 | //============================================================ 9 | 10 | using BTCore.Runtime; 11 | using BTCore.Runtime.Attributes; 12 | using BTCore.Runtime.Composites; 13 | using Sirenix.OdinInspector; 14 | 15 | namespace BTCore.Editor.Inspectors.Composites 16 | { 17 | [NodeInspector(typeof(RandomSequence))] 18 | public class RandomSequenceInspector : CompositeInspector 19 | { 20 | [ShowInInspector] 21 | [HorizontalGroup] 22 | [LabelText("Use Seed:")] 23 | [LabelWidth(100)] 24 | [OnValueChanged("OnFieldValueChanged")] 25 | private bool _useSeed; 26 | 27 | [ShowInInspector] 28 | [HorizontalGroup] 29 | [LabelText("Seed:")] 30 | [LabelWidth(40)] 31 | [ShowIf("_useSeed")] 32 | [OnValueChanged("OnFieldValueChanged")] 33 | private int _seed; 34 | 35 | private RandomSequence _sequence; 36 | 37 | 38 | public override BTNode ExportData() { 39 | return _sequence; 40 | } 41 | 42 | protected override void OnFieldValueChanged() { 43 | _sequence.Seed = _seed; 44 | _sequence.UseSeed = _useSeed; 45 | base.OnFieldValueChanged(); 46 | } 47 | 48 | protected override void OnImportData(RandomSequence data) { 49 | _sequence = data; 50 | _seed = data.Seed; 51 | _useSeed = data.UseSeed; 52 | } 53 | 54 | public override void Reset() { 55 | _sequence = null; 56 | AbortType = AbortType.None; 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Composites/RandomSequenceInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6e86cc98b5a74b019b2d24fe0584f68c 3 | timeCreated: 1720022755 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Composites/SelectorInspector.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: SelectorInspector.cs 3 | // Brief: SelectorInspector 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2024-06-24 8 | //============================================================ 9 | 10 | using BTCore.Runtime; 11 | using BTCore.Runtime.Attributes; 12 | using BTCore.Runtime.Composites; 13 | 14 | namespace BTCore.Editor.Inspectors.Composites 15 | { 16 | [NodeInspector(typeof(Selector))] 17 | public class SelectorInspector : CompositeInspector 18 | { 19 | private Selector _selector; 20 | 21 | protected override void OnFieldValueChanged() { 22 | _selector.AbortType = AbortType; 23 | base.OnFieldValueChanged(); 24 | } 25 | 26 | public override void Reset() { 27 | _selector = null; 28 | AbortType = AbortType.None; 29 | } 30 | 31 | public override BTNode ExportData() { 32 | return _selector; 33 | } 34 | 35 | protected override void OnImportData(Selector data) { 36 | _selector = data; 37 | AbortType = _selector.AbortType; 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Composites/SelectorInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f9a29ca488740808c7bdfd9f4b0cdef 3 | timeCreated: 1719218986 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Composites/SequenceInspector.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: SequenceInspector.cs 3 | // Brief: SequenceInspector 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2024-06-19 8 | //============================================================ 9 | 10 | using BTCore.Runtime; 11 | using BTCore.Runtime.Attributes; 12 | using BTCore.Runtime.Composites; 13 | 14 | namespace BTCore.Editor.Inspectors.Composites 15 | { 16 | [NodeInspector(typeof(Sequence))] 17 | public class SequenceInspector : CompositeInspector 18 | { 19 | private Sequence _sequence; 20 | 21 | protected override void OnImportData(Sequence data) { 22 | _sequence = data; 23 | AbortType = data.AbortType; 24 | } 25 | 26 | public override BTNode ExportData() { 27 | return _sequence; 28 | } 29 | 30 | protected override void OnFieldValueChanged() { 31 | _sequence.AbortType = AbortType; 32 | base.OnFieldValueChanged(); 33 | } 34 | 35 | public override void Reset() { 36 | _sequence = null; 37 | AbortType = AbortType.None; 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Composites/SequenceInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b350b8146fec48809643edcab46db4b6 3 | timeCreated: 1718789223 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Conditions.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b85d539f44404c76aa9b451304a19a23 3 | timeCreated: 1697438917 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Conditions/IsKeyDownInspector.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: IsKeyDownInspector.cs 3 | // Brief: IsKeyDownInspector 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2024-06-25 8 | //============================================================ 9 | 10 | using BTCore.Runtime; 11 | using BTCore.Runtime.Attributes; 12 | using BTCore.Runtime.Unity.Conditions; 13 | using Sirenix.OdinInspector; 14 | using UnityEngine; 15 | 16 | namespace BTCore.Editor.Inspectors.Conditions 17 | { 18 | [NodeInspector(typeof(IsKeyDown))] 19 | public class IsKeyDownInspector : BTNodeInspector 20 | { 21 | [ShowInInspector] 22 | [LabelText("按键:")] 23 | [LabelWidth(100)] 24 | [OnValueChanged("OnFieldValueChanged")] 25 | private KeyCode _keyCode; 26 | 27 | private IsKeyDown _isKeyDown; 28 | 29 | protected override void OnFieldValueChanged() { 30 | _isKeyDown.KeyCode = _keyCode; 31 | base.OnFieldValueChanged(); 32 | } 33 | 34 | public override void Reset() { 35 | _isKeyDown = null; 36 | _keyCode = KeyCode.None; 37 | } 38 | 39 | public override BTNode ExportData() { 40 | return _isKeyDown; 41 | } 42 | 43 | protected override void OnImportData(IsKeyDown data) { 44 | _isKeyDown = data; 45 | _keyCode = data.KeyCode; 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Conditions/IsKeyDownInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c60736e418d439980a09fa9777c6ead 3 | timeCreated: 1719310991 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Conditions/ProbabilityInspector.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: ProbabilityInspector.cs 3 | // Brief: ProbabilityInspector 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2023-10-16 8 | //============================================================ 9 | 10 | using BTCore.Runtime; 11 | using BTCore.Runtime.Attributes; 12 | using BTCore.Runtime.Conditions; 13 | using Sirenix.OdinInspector; 14 | 15 | namespace BTCore.Editor.Inspectors.Conditions 16 | { 17 | [NodeInspector(typeof(RandomProbability))] 18 | public class RandomProbabilityInspector : BTNodeInspector 19 | { 20 | [ShowInInspector] 21 | [LabelText("Probability(?)")] 22 | [LabelWidth(100)] 23 | [OnValueChanged("OnFieldValueChanged")] 24 | [PropertyTooltip("概率范围0 ~ 100")] 25 | private SharedValueInspector _probability = new SharedValueInspector(); 26 | 27 | private RandomProbability _probabilityData; 28 | 29 | protected override void OnImportData(RandomProbability data) { 30 | _probabilityData = data; 31 | _probability.ImportData(data.Probability); 32 | } 33 | 34 | public override BTNode ExportData() { 35 | return _probabilityData; 36 | } 37 | 38 | protected override void OnFieldValueChanged() { 39 | _probabilityData.Probability = _probability.ExportData(); 40 | base.OnFieldValueChanged(); 41 | } 42 | 43 | public override void Reset() { 44 | _probability = new SharedValueInspector(); 45 | _probabilityData = null; 46 | } 47 | } 48 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Conditions/ProbabilityInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef08f029a51049798d8d1d615a857b8c 3 | timeCreated: 1697438944 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Decorators.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c39afd9a0b5445beb985ada6762eaddb 3 | timeCreated: 1697441076 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Decorators/RepeaterInspector.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: RepeaterInspector.cs 3 | // Brief: RepeaterInspector 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2023-10-16 8 | //============================================================ 9 | 10 | using BTCore.Runtime; 11 | using BTCore.Runtime.Attributes; 12 | using BTCore.Runtime.Composites; 13 | using BTCore.Runtime.Decorators; 14 | using Sirenix.OdinInspector; 15 | 16 | namespace BTCore.Editor.Inspectors.Decorators 17 | { 18 | [NodeInspector(typeof(Repeater))] 19 | public class RepeaterInspector : BTNodeInspector 20 | { 21 | [ShowInInspector] 22 | [LabelText("Repeat Count(?)")] 23 | [LabelWidth(100)] 24 | [OnValueChanged("OnFieldValueChanged")] 25 | [PropertyTooltip("循环次数,设定为负数一直循环执行")] 26 | private int _count; 27 | 28 | private Repeater _repeater; 29 | 30 | protected override void OnImportData(Repeater data) { 31 | _repeater = data; 32 | _count = data.RepeatCount; 33 | } 34 | 35 | public override BTNode ExportData() { 36 | return _repeater; 37 | } 38 | 39 | protected override void OnFieldValueChanged() { 40 | _repeater.RepeatCount = _count; 41 | base.OnFieldValueChanged(); 42 | } 43 | 44 | public override void Reset() { 45 | _count = 0; 46 | _repeater = null; 47 | } 48 | } 49 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Decorators/RepeaterInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: abe930883b954ade9b9b5a8d42259eda 3 | timeCreated: 1697441152 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Externals.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 77690f7405c343ad8be1a537d34fcc35 3 | timeCreated: 1718794839 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Externals/ExternalActionInspector.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: ExternalActionInspector.cs 3 | // Brief: ExternalActionInspector 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2023-10-18 8 | //============================================================ 9 | 10 | using BTCore.Runtime; 11 | using BTCore.Runtime.Attributes; 12 | using BTCore.Runtime.Externals; 13 | 14 | namespace BTCore.Editor.Inspectors.Externals 15 | { 16 | [NodeInspector(typeof(ExternalAction))] 17 | public class ExternalActionInspector : ExternalNodeInspector 18 | { 19 | protected override string GetInfoMessage() { 20 | return "必须填写外部Action类型名称!"; 21 | } 22 | 23 | protected override string GetTitleName() { 24 | return "External Action"; 25 | } 26 | 27 | public override BTNode ExportData() { 28 | return ExternalNode as BTNode; 29 | } 30 | 31 | protected override void OnImportData(ExternalAction data) { 32 | ExternalNode = data; 33 | TypeName = data.TypeName; 34 | Properties = data.Properties; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Externals/ExternalActionInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b3dc3bb7c2dd43c1baeee48f494ed071 3 | timeCreated: 1697617186 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Externals/ExternalConditionInspector.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: ExternalCondition.cs 3 | // Brief: ExternalCondition 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2023-10-18 8 | //============================================================ 9 | 10 | using BTCore.Runtime; 11 | using BTCore.Runtime.Attributes; 12 | using BTCore.Runtime.Externals; 13 | 14 | namespace BTCore.Editor.Inspectors.Externals 15 | { 16 | [NodeInspector(typeof(ExternalCondition))] 17 | public class ExternalConditionInspector : ExternalNodeInspector 18 | { 19 | protected override string GetInfoMessage() { 20 | return "必须填写外部Condition类型名称!"; 21 | } 22 | 23 | protected override string GetTitleName() { 24 | return "External Condition"; 25 | } 26 | 27 | public override BTNode ExportData() { 28 | return ExternalNode as BTNode; 29 | } 30 | 31 | protected override void OnImportData(ExternalCondition data) { 32 | ExternalNode = data; 33 | TypeName = data.TypeName; 34 | Properties = data.Properties; 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Externals/ExternalConditionInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2177ac8c6024910a3346459f534eeee 3 | timeCreated: 1697624406 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Externals/ExternalNodeInspector.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: ExternalNodeInspector.cs 3 | // Brief: ExternalNodeInspector 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2023-10-18 8 | //============================================================ 9 | 10 | using System.Collections.Generic; 11 | using BTCore.Runtime; 12 | using BTCore.Runtime.Externals; 13 | using Sirenix.OdinInspector; 14 | 15 | namespace BTCore.Editor.Inspectors.Externals 16 | { 17 | public abstract class ExternalNodeInspector : BTNodeInspector where T : BTNode 18 | { 19 | [TitleGroup("$GetTitleName")] 20 | [ShowInInspector] 21 | [LabelText("TypeName")] 22 | [LabelWidth(100)] 23 | [OnValueChanged("OnFieldValueChanged")] 24 | [ValidateInput("StringValidator", "$GetInfoMessage", ContinuousValidationCheck = true)] 25 | protected string TypeName; 26 | 27 | [TitleGroup("$GetTitleName")] 28 | [ShowInInspector] 29 | [OnValueChanged("OnFieldValueChanged")] 30 | protected Dictionary Properties = new Dictionary(); 31 | 32 | protected IExternalNode ExternalNode; 33 | 34 | private bool StringValidator(string value) 35 | { 36 | return !string.IsNullOrEmpty(value); 37 | } 38 | 39 | protected abstract string GetInfoMessage(); 40 | 41 | protected abstract string GetTitleName(); 42 | 43 | protected override void OnFieldValueChanged() { 44 | if (ExternalNode == null) { 45 | return; 46 | } 47 | 48 | ExternalNode.TypeName = TypeName; 49 | ExternalNode.Properties = Properties; 50 | // 更新Name字段,同步更新对应NodeView的title显示 51 | if (ExternalNode is BTNode node) { 52 | node.Name = TypeName; 53 | node.Comment = Comment; 54 | base.OnFieldValueChanged(); 55 | } 56 | } 57 | 58 | public override void Reset() { 59 | TypeName = null; 60 | Properties = new Dictionary(); 61 | ExternalNode = null; 62 | } 63 | } 64 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/Externals/ExternalNodeInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4b03f7092ab4863b5243ed996c9b24e 3 | timeCreated: 1697621808 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/InspectorBase.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: InspectorBase.cs 3 | // Brief: InspectorBase 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2023-10-09 8 | //============================================================ 9 | 10 | using Sirenix.OdinInspector; 11 | 12 | namespace BTCore.Editor.Inspectors 13 | { 14 | public abstract class InspectorBase : SerializedScriptableObject 15 | { 16 | protected abstract void OnFieldValueChanged(); 17 | 18 | public abstract void Reset(); 19 | } 20 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/InspectorBase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5e95ccc64924fdeaeb4941328139661 3 | timeCreated: 1696842702 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/MonoBehaviours.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7fd195380b394b0996056155ce0273eb 3 | timeCreated: 1719636736 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/MonoBehaviours/BehaviorTreeInspector.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: BehaviorTreeInspector.cs 3 | // Brief: BehaviorTreeInspector 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2024-06-29 8 | //============================================================ 9 | 10 | using BTCore.Runtime.Unity; 11 | using UnityEditor; 12 | using UnityEngine; 13 | 14 | namespace BTCore.Editor.Inspectors.MonoBehaviours 15 | { 16 | [CustomEditor(typeof(BehaviorTree))] 17 | public class BehaviorTreeInspector : UnityEditor.Editor 18 | { 19 | private SerializedProperty _btAsset; 20 | private BehaviorTree _behaviorTree; 21 | 22 | private void OnEnable() { 23 | _btAsset = serializedObject.FindProperty("_btAsset"); 24 | _behaviorTree = (BehaviorTree) target; 25 | } 26 | 27 | public override void OnInspectorGUI() { 28 | serializedObject.Update(); 29 | 30 | EditorGUILayout.BeginHorizontal(); 31 | EditorGUI.BeginChangeCheck(); 32 | 33 | EditorGUILayout.PropertyField(_btAsset, new GUIContent("BTAsset")); 34 | // 立即更新变化值 35 | serializedObject.ApplyModifiedProperties(); 36 | // BTAsset有变化时,若BT窗口已经打开需更新显示 37 | if (EditorGUI.EndChangeCheck()) { 38 | if (BTEditorWindow.Instance == null) { 39 | return; 40 | } 41 | _behaviorTree.CreateBTree(); 42 | BTEditorWindow.Instance.SelectNewTree(_behaviorTree.BTree); 43 | } 44 | 45 | if (GUILayout.Button("Open", GUILayout.Width(50))) { 46 | if (BTEditorWindow.Instance == null) { 47 | BTEditorWindow.OpenWindow(); 48 | } 49 | 50 | if (_behaviorTree.BTree == null) { 51 | _behaviorTree.CreateBTree(); 52 | } 53 | 54 | BTEditorWindow.Instance.SelectNewTree(_behaviorTree.BTree); 55 | } 56 | 57 | EditorGUILayout.EndHorizontal(); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/MonoBehaviours/BehaviorTreeInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a1942e2095a4b37bf3215ea451c4f65 3 | timeCreated: 1719630756 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Inspectors/SharedValueInspector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 90bc8fc7331c4cdcb773d48841152a6c 3 | timeCreated: 1696956774 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/NodeInspectorView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bce880b7f3264cb3a415908461512e30 3 | timeCreated: 1696239098 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/NodePort.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7a90eff32ad4dc09bdf305bbdf0ca6c 3 | timeCreated: 1696494457 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/NodeSearchWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7398e03233ba43faa0b98c41534c2da5 3 | timeCreated: 1696492504 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 709275f0a4244f941a208b665feb39d2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Resources/ConditionalAbortBothIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Saroce/BehaviorTreeEditor/aa914178e9e8637ce7955bc9784331f6f1cf4a0f/Assets/BTCore/Editor/Resources/ConditionalAbortBothIcon.png -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Resources/ConditionalAbortLowerPriorityIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Saroce/BehaviorTreeEditor/aa914178e9e8637ce7955bc9784331f6f1cf4a0f/Assets/BTCore/Editor/Resources/ConditionalAbortLowerPriorityIcon.png -------------------------------------------------------------------------------- /Assets/BTCore/Editor/Resources/ConditionalAbortSelfIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Saroce/BehaviorTreeEditor/aa914178e9e8637ce7955bc9784331f6f1cf4a0f/Assets/BTCore/Editor/Resources/ConditionalAbortSelfIcon.png -------------------------------------------------------------------------------- /Assets/BTCore/Editor/SplitView.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------ 2 | // File: SplitView.cs 3 | // Brief: SplitView 4 | // 5 | // Author: Saroce, Saroce233@163.com 6 | // 7 | // Modified: 2023-10-02 8 | //============================================================ 9 | 10 | using UnityEngine.UIElements; 11 | 12 | namespace BTCore.Editor 13 | { 14 | public class SplitView : TwoPaneSplitView 15 | { 16 | public new class UxmlFactory : UxmlFactory { } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/BTCore/Editor/SplitView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2817d423773c42b4aa112490c2d91756 3 | timeCreated: 1696238507 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/UIBuilder.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 09cba6d41c5f40b19f930ab985819deb 3 | timeCreated: 1696236751 -------------------------------------------------------------------------------- /Assets/BTCore/Editor/UIBuilder/BTEditorWindow.uxml: -------------------------------------------------------------------------------- 1 | 2 |