Skip to content

Commit 7c9b09b

Browse files
authored
docs: explained how to disable formatting
1 parent f1de0c7 commit 7c9b09b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Diff for: README.md

+20
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ with units who attempt to capture the flag while grabbing power ups to try and g
158158
+ [Custom Conditions](#custom-conditions)
159159
+ [Custom Composites](#custom-composites)
160160
+ [Custom Decorators](#custom-decorators)
161+
* [Formatting Issues](#formatting-issues)
161162
* [Nightly Builds](#nightly-builds)
162163
* [Development Environment](#development-environment)
163164
+ [Submitting your own actions, conditions, ect](#making-commits)
@@ -675,6 +676,25 @@ public static class BehaviorTreeBuilderExtensions {
675676
}
676677
```
677678

679+
## Formatting Issues
680+
681+
If you are using an auto formatter it will probably mangle your code formatting with the builder syntax. To avoid this you can turn off formatting like so in JetBrains Rider. If you need a specific IDE, it shouldn't be too hard to google the specific formatting disable comment you need.
682+
683+
```c#
684+
// @formatter:off
685+
_tree = new BehaviorTreeBuilder(gameObject)
686+
.Sequence()
687+
.Condition("Custom Condition", () => {
688+
return true;
689+
})
690+
.Do("Custom Action", () => {
691+
return TaskStatus.Success;
692+
})
693+
.End()
694+
.Build();
695+
// @formatter:on
696+
```
697+
678698
## Nightly Builds
679699

680700
To access nightly builds of `develop` that are package manager friendly you'll need to manually edit your `Packages/manifest.json` as so.

0 commit comments

Comments
 (0)