Merge pull request #95 from limbonaut/decorator-default-tick
BTDecorator: Add default `_tick` implementation
This commit is contained in:
commit
0e843d3193
|
@ -18,3 +18,8 @@ PackedStringArray BTDecorator::get_configuration_warnings() {
|
||||||
}
|
}
|
||||||
return warnings;
|
return warnings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BT::Status BTDecorator::_tick(double p_delta) {
|
||||||
|
ERR_FAIL_COND_V_MSG(get_child_count() == 0, FAILURE, "BT decorator doesn't have a child.");
|
||||||
|
return get_child(0)->execute(p_delta);
|
||||||
|
}
|
||||||
|
|
|
@ -17,6 +17,9 @@
|
||||||
class BTDecorator : public BTTask {
|
class BTDecorator : public BTTask {
|
||||||
GDCLASS(BTDecorator, BTTask)
|
GDCLASS(BTDecorator, BTTask)
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual Status _tick(double p_delta) override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual PackedStringArray get_configuration_warnings() override;
|
virtual PackedStringArray get_configuration_warnings() override;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue