From dcab5ca51f9708e16266f3d516cf65c01e7df3fc Mon Sep 17 00:00:00 2001 From: Dmitry Baltin Date: Sat, 6 Sep 2025 13:31:13 +0200 Subject: [PATCH 1/4] refactoring: rename nodes class --- Runtime/{UnitaskFbtNodes.cs => MainNodes.cs} | 0 Runtime/{UnitaskFbtNodes.cs.meta => MainNodes.cs.meta} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename Runtime/{UnitaskFbtNodes.cs => MainNodes.cs} (100%) rename Runtime/{UnitaskFbtNodes.cs.meta => MainNodes.cs.meta} (100%) diff --git a/Runtime/UnitaskFbtNodes.cs b/Runtime/MainNodes.cs similarity index 100% rename from Runtime/UnitaskFbtNodes.cs rename to Runtime/MainNodes.cs diff --git a/Runtime/UnitaskFbtNodes.cs.meta b/Runtime/MainNodes.cs.meta similarity index 100% rename from Runtime/UnitaskFbtNodes.cs.meta rename to Runtime/MainNodes.cs.meta From b2e73814da3b627488942b08fd43dcb2037bed4d Mon Sep 17 00:00:00 2001 From: Dmitry Baltin Date: Sat, 6 Sep 2025 13:32:04 +0200 Subject: [PATCH 2/4] refactoring: rename nodes class --- Runtime/MainNodes.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runtime/MainNodes.cs b/Runtime/MainNodes.cs index 0edf00d..87be520 100644 --- a/Runtime/MainNodes.cs +++ b/Runtime/MainNodes.cs @@ -13,7 +13,7 @@ namespace Baltin.UFBT /// 3. Extremely fast, because here inside there are only the simplest conditions, loops and procedure calls /// /// Type of 'blackboard' that represents the controlled object. - public static class UnitaskFbtNodes + public static class MainNodes { /// /// Execute the given func delegate if the given condition is true From 62dcb39a896b590e408c959f3949d22b233719fb Mon Sep 17 00:00:00 2001 From: Dmitry Baltin Date: Sat, 6 Sep 2025 13:38:36 +0200 Subject: [PATCH 3/4] docs: Update README.md --- README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index ff3d37a..c37be32 100644 --- a/README.md +++ b/README.md @@ -29,19 +29,19 @@ With **UnitaskFBT**, you can use async/await syntax to handle long-running actio ## Example of Usage ```csharp - await npcBoard.Sequencer(c, //Sequencer node - static async (b, c) => await b.FindTarget(), //Action node realized as a delegate Func> - static async (b, c) => await b.Selector(c, //Selector node - static async (b, c) => await b.If(c, //Conditional node - static b => b.TargetDistance < 1f, //Condition - static async (b, c) => await b.MeleeAttack()), - static async (b, c) => await b.If(c, + await npcBoard.Sequencer( //Sequencer node + static b => b.FindTarget(), //Action node realized as a delegate Func> + static b => b.Selector( //Selector node + static b => b.If( //Conditional node + static b => b.TargetDistance < 1f, //Condition + static b => b.MeleeAttack()), //Action + static b => b.If( static b => b.TargetDistance < 3f, - static async (b, c) => await b.RangeAttack()), //RangeAttack() is the only continuous function in this BT allowing be in the running state - static async (b, c) => await b.If(c, + static b => b.RangeAttack()), //The only continuous function here that can be "running" + static b => b.If( static b => b.TargetDistance < 8f, - static async (b, c) => await b.Move()), - static async (b, c) => await b.Idle())); + static b => b.Move()), + static b => b.Idle())); ``` Notes: @@ -50,8 +50,8 @@ Notes: - The construction static async (b, c) => await … in each line may look verbose, but it’s a small price to pay for the huge advantages of an asynchronous behavior tree. - If a node needs to continue execution in the next cycle, it does not return Running. Instead, it suspends itself (e.g., using await UniTask.Yield()). In the example above, this happens inside RangeAttack(). - Since there is no Running state, nodes simply return a boolean (bool) rather than a Status, which simplifies the logic. -- All nodes accept a CancellationToken for operation cancellation. - No closures are used; only static delegates are employed, which avoids additional memory allocations. +- If CancellationToken required it can be added to Blackboard object For a detailed comparison between UnitaskFBT and a classical FBT, see this repository [FbtExample](https://github.com/dmitrybaltin/FbtExample) From a4042834574a4f21ad260363ce2c25f3ee65da24 Mon Sep 17 00:00:00 2001 From: Dmitry Baltin Date: Sat, 6 Sep 2025 13:41:37 +0200 Subject: [PATCH 4/4] chore: increment version number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f5798dd..9d3548d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "com.baltin.ufbt", - "version": "0.6.0", + "version": "0.6.1", "displayName": "UniTaskFBT", "description": "Async Functional Behavior Tree implementation based on UniTask", "unity": "2021.2",