Implement CSharpScript::inherits_script()

(cherry picked from commit 840255a04b)
This commit is contained in:
Ignacio Etcheverry 2020-05-10 21:49:15 +02:00 committed by Pedro J. Estébanez
parent 7426b3fa91
commit 417a69c643

View file

@ -3211,8 +3211,15 @@ bool CSharpScript::inherits_script(const Ref<Script> &p_script) const {
return false;
}
WARN_PRINT_ONCE("Implement CSharpScript::inherits_script and other relevant changes after GH-38063.");
return false;
if (script_class == nullptr || cs->script_class == nullptr) {
return false;
}
if (script_class == cs->script_class) {
return true;
}
return cs->script_class->is_assignable_from(script_class);
}
Ref<Script> CSharpScript::get_base_script() const {