File tree Expand file tree Collapse file tree 3 files changed +6
-22
lines changed
Assets/FluidBehaviorTree/Runtime/Decorators Expand file tree Collapse file tree 3 files changed +6
-22
lines changed Original file line number Diff line number Diff line change 55namespace CleverCrow . Fluid . BTs . Decorators {
66 public class RepeatForever : DecoratorBase {
77 protected override TaskStatus OnUpdate ( ) {
8- Child ? . Update ( ) ;
8+ Child . Update ( ) ;
99 return TaskStatus . Continue ;
1010 }
1111 }
Original file line number Diff line number Diff line change 55namespace CleverCrow . Fluid . BTs . Decorators {
66 public class RepeatUntilFailure : DecoratorBase {
77 protected override TaskStatus OnUpdate ( ) {
8- if ( Child == null ) {
8+ if ( Child . Update ( ) == TaskStatus . Failure ) {
99 return TaskStatus . Failure ;
1010 }
11-
12- var childStatus = Child . Update ( ) ;
13- var status = childStatus ;
14-
15- if ( status == TaskStatus . Failure ) {
16- return TaskStatus . Failure ;
17- }
18- else {
19- return TaskStatus . Continue ;
20- }
11+
12+ return TaskStatus . Continue ;
2113 }
2214 }
2315}
Original file line number Diff line number Diff line change 55namespace CleverCrow . Fluid . BTs . Decorators {
66 public class RepeatUntilSuccess : DecoratorBase {
77 protected override TaskStatus OnUpdate ( ) {
8- if ( Child == null ) {
8+ if ( Child . Update ( ) == TaskStatus . Success ) {
99 return TaskStatus . Success ;
1010 }
1111
12- var childStatus = Child . Update ( ) ;
13- var status = childStatus ;
14-
15- if ( status == TaskStatus . Success ) {
16- return TaskStatus . Success ;
17- }
18- else {
19- return TaskStatus . Continue ;
20- }
12+ return TaskStatus . Continue ;
2113 }
2214 }
2315}
You can’t perform that action at this time.
0 commit comments