Browse Source

Add script binding for Node::IsChildOf.

Eugene Kozlov 8 years ago
parent
commit
d60e96c866

+ 1 - 0
Source/Urho3D/AngelScript/APITemplates.h

@@ -722,6 +722,7 @@ template <class T> void RegisterNode(asIScriptEngine* engine, const char* classN
     engine->RegisterObjectMethod(className, "Array<Component@>@ GetComponents(const String&in, bool recursive = false) const", asFUNCTION(NodeGetComponentsWithType), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod(className, "Component@+ GetComponent(const String&in, bool recursive = false) const", asFUNCTION(NodeGetComponentWithType), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod(className, "Component@+ GetParentComponent(const String&in, bool fullTraversal = false) const", asFUNCTION(NodeGetParentComponentWithType), asCALL_CDECL_OBJLAST);
+    engine->RegisterObjectMethod(className, "bool IsChildOf(Node@+) const", asMETHOD(T, IsChildOf), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "bool HasComponent(const String&in) const", asFUNCTION(NodeHasComponent), asCALL_CDECL_OBJLAST);
     engine->RegisterObjectMethod(className, "bool HasTag(const String&in)", asMETHOD(T, HasTag), asCALL_THISCALL);
     engine->RegisterObjectMethod(className, "Array<String>@ get_tags()", asFUNCTION(NodeGetTags), asCALL_CDECL_OBJLAST);

+ 1 - 0
Source/Urho3D/LuaScript/pkgs/Scene/Node.pkg

@@ -132,6 +132,7 @@ class Node : public Animatable
     StringHash GetNameHash() const;
     Node* GetParent() const;
     Scene* GetScene() const;
+    bool IsChildOf(Node* node) const;
     bool IsEnabled() const;
     bool IsEnabledSelf() const;
     Connection* GetOwner() const;