Merge pull request #51166 from RandomShaper/fix_can_reset_3.x

This commit is contained in:
Rémi Verschelde 2021-08-09 09:19:25 +02:00 committed by GitHub
commit a418d09617
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 154 additions and 77 deletions

View file

@ -3211,6 +3211,23 @@ void CSharpScript::get_script_signal_list(List<MethodInfo> *r_signals) const {
}
}
bool CSharpScript::inherits_script(const Ref<Script> &p_script) const {
Ref<CSharpScript> cs = p_script;
if (cs.is_null()) {
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 {
// TODO search in metadata file once we have it, not important any way?
return Ref<Script>();