| 113 | } |
| 114 | |
| 115 | Variant GDScriptNativeClass::callp(const StringName &p_method, const Variant **p_args, int p_argcount, Callable::CallError &r_error) { |
| 116 | if (p_method == SNAME("new")) { |
| 117 | // Constructor. |
| 118 | return Object::callp(p_method, p_args, p_argcount, r_error); |
| 119 | } |
| 120 | MethodBind *method = ClassDB::get_method(name, p_method); |
| 121 | if (method && method->is_static()) { |
| 122 | // Native static method. |
| 123 | return method->call(nullptr, p_args, p_argcount, r_error); |
| 124 | } |
| 125 | |
| 126 | r_error.error = Callable::CallError::CALL_ERROR_INVALID_METHOD; |
| 127 | return Variant(); |
| 128 | } |
| 129 | |
| 130 | GDScriptFunction *GDScript::_super_constructor(GDScript *p_script) { |
| 131 | if (likely(p_script->valid) && p_script->initializer) { |