Skip to content

Commit 29215a6

Browse files
committed
docs(readme): added SelectorRandom docs
1 parent b310707 commit 29215a6

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,11 @@ public class ExampleUsage : MonoBehaviour {
124124
- [Wait Time](#wait-time)
125125
+ [Conditions](#conditions)
126126
- [Generic](#condition-generic)
127-
- [Random Chance](#random-chance)
127+
- [RandomChance](#random-chance)
128128
+ [Composites](#composites)
129129
- [Sequence](#sequence)
130130
- [Selector](#selector)
131+
- [SelectorRandom](#selector-random)
131132
- [Parallel](#parallel)
132133
+ [Decorators](#decorators)
133134
- [Generic](#decorator-generic)
@@ -209,7 +210,7 @@ look into the section on writing your own custom conditions.
209210
.End()
210211
```
211212

212-
#### Random Chance
213+
#### RandomChance
213214

214215
Randomly evaluate a node as true or false based upon the passed chance.
215216

@@ -259,6 +260,18 @@ Runs each child node until *Success* is returned.
259260
.End()
260261
```
261262

263+
#### SelectorRandom
264+
265+
Randomly selects a child node with a shuffle algorithm. Looks until `Success` is returned or every node fails. Shuffles every time the tree initially start running it.
266+
267+
```C#
268+
.SelectorRandom()
269+
.Do(() => { return TaskStatus.Failure; })
270+
.Do(() => { return TaskStatus.Success; })
271+
.Do(() => { return TaskStatus.Failure; })
272+
.End()
273+
```
274+
262275
#### Parallel
263276

264277
Runs all child nodes at the same time until they all return *Success*. Exits and stops all running nodes if ANY of them return *Failure*.

0 commit comments

Comments
 (0)