mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Create API to add and remove VisualScript custom nodes
This makes a VisualScriptEditor singleton, which gives plugins the ability to register their own custom nodes. Those will be available for insertion in the Visual Script editor, under the "Custom Nodes" category.
This commit is contained in:
parent
9543801d51
commit
0284727e7b
7 changed files with 135 additions and 0 deletions
|
|
@ -2644,6 +2644,11 @@ void VisualScriptLanguage::add_register_func(const String &p_name, VisualScriptN
|
|||
register_funcs[p_name] = p_func;
|
||||
}
|
||||
|
||||
void VisualScriptLanguage::remove_register_func(const String &p_name) {
|
||||
ERR_FAIL_COND(!register_funcs.has(p_name));
|
||||
register_funcs.erase(p_name);
|
||||
}
|
||||
|
||||
Ref<VisualScriptNode> VisualScriptLanguage::create_node_from_name(const String &p_name) {
|
||||
|
||||
ERR_FAIL_COND_V(!register_funcs.has(p_name), Ref<VisualScriptNode>());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue