Add set_agent()
This commit is contained in:
parent
d359f620e3
commit
7ec38e0988
|
@ -272,17 +272,22 @@ void BTTask::_bind_methods() {
|
||||||
// Properties.
|
// Properties.
|
||||||
ClassDB::bind_method(D_METHOD("get_custom_name"), &BTTask::get_custom_name);
|
ClassDB::bind_method(D_METHOD("get_custom_name"), &BTTask::get_custom_name);
|
||||||
ClassDB::bind_method(D_METHOD("set_custom_name", "p_name"), &BTTask::set_custom_name);
|
ClassDB::bind_method(D_METHOD("set_custom_name", "p_name"), &BTTask::set_custom_name);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::STRING, "custom_name"), "set_custom_name", "get_custom_name");
|
|
||||||
ClassDB::bind_method(D_METHOD("get_agent"), &BTTask::get_agent);
|
ClassDB::bind_method(D_METHOD("get_agent"), &BTTask::get_agent);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "agent", PROPERTY_HINT_NONE, "", 0, "Object"), "", "get_agent");
|
ClassDB::bind_method(D_METHOD("set_agent", "p_agent"), &BTTask::set_agent);
|
||||||
ClassDB::bind_method(D_METHOD("get_blackboard"), &BTTask::get_blackboard);
|
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "blackboard", PROPERTY_HINT_NONE, "", 0, "Blackboard"), "", "get_blackboard");
|
|
||||||
ClassDB::bind_method(D_METHOD("get_parent"), &BTTask::get_parent);
|
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "parent", PROPERTY_HINT_NONE, "", 0, "BTTask"), "", "get_parent");
|
|
||||||
ClassDB::bind_method(D_METHOD("get_children"), &BTTask::_get_children);
|
ClassDB::bind_method(D_METHOD("get_children"), &BTTask::_get_children);
|
||||||
ClassDB::bind_method(D_METHOD("set_children", "p_children"), &BTTask::_set_children);
|
ClassDB::bind_method(D_METHOD("set_children", "p_children"), &BTTask::_set_children);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "children", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_children", "get_children");
|
|
||||||
|
ClassDB::bind_method(D_METHOD("get_blackboard"), &BTTask::get_blackboard);
|
||||||
|
ClassDB::bind_method(D_METHOD("get_parent"), &BTTask::get_parent);
|
||||||
ClassDB::bind_method(D_METHOD("get_status"), &BTTask::get_status);
|
ClassDB::bind_method(D_METHOD("get_status"), &BTTask::get_status);
|
||||||
|
|
||||||
|
ADD_PROPERTY(PropertyInfo(Variant::STRING, "custom_name"), "set_custom_name", "get_custom_name");
|
||||||
|
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "agent", PROPERTY_HINT_RESOURCE_TYPE, "Object", 0), "set_agent", "get_agent");
|
||||||
|
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "blackboard", PROPERTY_HINT_RESOURCE_TYPE, "Blackboard", 0), "", "get_blackboard");
|
||||||
|
ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "parent", PROPERTY_HINT_NONE, "", 0, "BTTask"), "", "get_parent");
|
||||||
|
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "children", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_NOEDITOR), "set_children", "get_children");
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::INT, "status"), "", "get_status");
|
ADD_PROPERTY(PropertyInfo(Variant::INT, "status"), "", "get_status");
|
||||||
|
|
||||||
// Virtual methods.
|
// Virtual methods.
|
||||||
|
|
|
@ -48,6 +48,7 @@ protected:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Object *get_agent() const { return agent; }
|
Object *get_agent() const { return agent; }
|
||||||
|
void set_agent(Object *p_agent) { agent = p_agent; }
|
||||||
Ref<Blackboard> get_blackboard() const { return blackboard; }
|
Ref<Blackboard> get_blackboard() const { return blackboard; }
|
||||||
Ref<BTTask> get_parent() const { return Ref<BTTask>(parent); }
|
Ref<BTTask> get_parent() const { return Ref<BTTask>(parent); }
|
||||||
bool is_root() const { return parent == nullptr; }
|
bool is_root() const { return parent == nullptr; }
|
||||||
|
|
Loading…
Reference in New Issue