You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Implement inherits_script() for NativeScript and PluginScript
This commit is contained in:
@@ -139,9 +139,20 @@ bool PluginScript::can_instantiate() const {
|
||||
}
|
||||
|
||||
bool PluginScript::inherits_script(const Ref<Script> &p_script) const {
|
||||
#ifndef _MSC_VER
|
||||
#warning inheritance needs to be implemented in PluginScript
|
||||
#endif
|
||||
Ref<PluginScript> ps = p_script;
|
||||
if (ps.is_null()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const PluginScript *s = this;
|
||||
|
||||
while (s) {
|
||||
if (s == p_script.ptr()) {
|
||||
return true;
|
||||
}
|
||||
s = Object::cast_to<PluginScript>(s->_ref_base_parent.ptr());
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user