mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Add a keyword for abstract classes in GDScript
Co-authored-by: Danil Alexeev <danil@alexeev.xyz>
This commit is contained in:
parent
730adf4801
commit
067704f1cd
17 changed files with 137 additions and 42 deletions
|
|
@ -219,6 +219,10 @@ bool CreateDialog::_should_hide_type(const StringName &p_type) const {
|
|||
i = script_path.find_char('/', i + 1);
|
||||
}
|
||||
}
|
||||
// Abstract scripts cannot be instantiated.
|
||||
String path = ScriptServer::get_global_class_path(p_type);
|
||||
Ref<Script> scr = ResourceLoader::load(path, "Script");
|
||||
return scr.is_null() || scr->is_abstract();
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue