1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

C#: Abstract script class support

This commit is contained in:
398utubzyt
2023-05-23 09:25:34 -07:00
parent 3ed4497113
commit 2df37a237a
16 changed files with 73 additions and 20 deletions

View File

@@ -880,7 +880,10 @@ void Object::set_script(const Variant &p_script) {
}
Ref<Script> s = p_script;
ERR_FAIL_COND_MSG(s.is_null() && !p_script.is_null(), "Invalid parameter, it should be a reference to a valid script (or null).");
if (!p_script.is_null()) {
ERR_FAIL_COND_MSG(s.is_null(), "Cannot set object script. Parameter should be null or a reference to a valid script.");
ERR_FAIL_COND_MSG(s->is_abstract(), vformat("Cannot set object script. Script '%s' should not be abstract.", s->get_path()));
}
script = p_script;