### Install Behaviour Tree Editor via Git URL Source: https://github.com/thekiwicoder0/unitybehaviourtreeeditor/blob/main/README.md To install the BehaviourTreeEditor, use the 'Add Package From git URL' command in Unity's Package Manager and provide the repository URL. Ensure Git is installed on your system if you encounter related errors. ```markdown https://github.com/thekiwicoder0/UnityBehaviourTreeEditor.git ``` -------------------------------- ### Read and Write to Blackboard from MonoBehaviour Source: https://github.com/thekiwicoder0/unitybehaviourtreeeditor/blob/main/README.md Demonstrates how to get and set blackboard values from a MonoBehaviour script. It shows both a simple version that looks up keys on each call and a cached version for performance in Update loops. ```csharp public class BlackboardController : MonoBehaviour { public BehaviourTreeInstance behaviourTreeInstance; // Assign in the inspector BlackboardKey keyReference; // Cache the key reference to avoid lookups each frame void Start() { // Simple version. Finds the key on each call to Get/Set int value = behaviourTreeInstance.GetBlackboardValue("MyInt"); behaviourTreeInstance.SetBlackboardValue("MyInt", value + 42); // Cached version, find the key and store a reference to it. keyReference = behaviourTreeInstance.FindBlackboardKey("MyInt"); } void Update() { // Avoids key lookup each frame. keyReference.value += 42; } } ``` -------------------------------- ### Action Node Template Source: https://github.com/thekiwicoder0/unitybehaviourtreeeditor/blob/main/Editor/ScriptTemplates/ActionNodeTemplate.txt This is a basic template for a custom Action Node. Implement OnStart, OnStop, and OnUpdate to define the node's behavior. ```csharp using System.Collections; using System.Collections.Generic; using UnityEngine; using TheKiwiCoder; [System.Serializable] public class #SCRIPTNAME# : ActionNode { protected override void OnStart() { } protected override void OnStop() { } protected override State OnUpdate() { return State.Success; } } ``` -------------------------------- ### Read and Write Blackboard Keys with NodeProperty Source: https://github.com/thekiwicoder0/unitybehaviourtreeeditor/blob/main/README.md Use the NodeProperty class to easily read and write blackboard keys from nodes. Add a public NodeProperty variable to your node and use its 'Value' property. A fixed default value can also be set directly on the node. ```csharp [System.Serializable] public class TestNode : ActionNode { public NodeProperty myInt; ... protected override State OnUpdate() { int value = myInt.Value; Debug.Log("Value:" = value); myInt.Value = value + 1; return State.Success; } } ``` -------------------------------- ### C# Composite Node Template Source: https://github.com/thekiwicoder0/unitybehaviourtreeeditor/blob/main/Editor/ScriptTemplates/CompositeNodeTemplate.txt This is a basic template for a custom Composite Node. It includes the necessary overrides for OnStart, OnStop, and OnUpdate methods. ```C# using System.Collections; using System.Collections.Generic; using UnityEngine; using TheKiwiCoder; [System.Serializable] public class #SCRIPTNAME# : CompositeNode { protected override void OnStart() { } protected override void OnStop() { } protected override State OnUpdate() { return State.Success; } } ``` -------------------------------- ### C# Decorator Node Template Source: https://github.com/thekiwicoder0/unitybehaviourtreeeditor/blob/main/Editor/ScriptTemplates/DecoratorNodeTempalte.txt This is a basic template for a custom Decorator Node. Override OnStart, OnStop, and OnUpdate to implement custom logic. ```C# using System.Collections; using System.Collections.Generic; using UnityEngine; using TheKiwiCoder; [System.Serializable] public class #SCRIPTNAME# : DecoratorNode { protected override void OnStart() { } protected override void OnStop() { } protected override State OnUpdate() { return State.Success; } } ``` -------------------------------- ### Declare Custom BlackboardKey Type Source: https://github.com/thekiwicoder0/unitybehaviourtreeeditor/blob/main/README.md Register a custom type for use in the blackboard by creating a class that inherits from BlackboardKey. The editor uses PropertyDrawers to render the inspector view for your type. ```csharp [System.Serializable] public class MyTypeKey : BlackboardKey { } ``` -------------------------------- ### C# Condition Node Template Source: https://github.com/thekiwicoder0/unitybehaviourtreeeditor/blob/main/Editor/ScriptTemplates/ConditionNodeTemplate.txt A basic template for a condition node in Unity Behaviour Trees. Inherits from ConditionNode and overrides the CheckCondition method. Returns false by default. ```C# using System.Collections; using System.Collections.Generic; using UnityEngine; using TheKiwiCoder; [System.Serializable] public class #SCRIPTNAME# : ConditionNode { protected override bool CheckCondition() { return false; } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.