using behaviac; public class MyAgent : behaviac.Agent { public bool isAttacking = false; protected override void Start() { base.Start(); // Create the behavior tree nodes SelectorNode root = new SelectorNode(); SequenceNode approachEnemy = new SequenceNode(); SequenceNode attack = new SequenceNode(); Blackboard bb = Workspace.Instance.Blackboard; // Add the nodes to the behavior tree root.AddChild(approachEnemy); root.AddChild(attack); approachEnemy.AddChild(new Condition(() => bb.GetBool("enemyInRange"))); approachEnemy.AddChild(new Action(() => MoveTowardsEnemy())); attack.AddChild(new Condition(() => isAttacking)); attack.AddChild(new Action(() => AttackEnemy())); SetBehaviorTree(new BehaviorTree(root)); } private void MoveTowardsEnemy() { // Move towards the enemy } private void AttackEnemy() { // Attack the enemy } }Behaviac is available as a standalone package library that can be easily integrated into any C# project.