MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / set_script_instance

Method set_script_instance

core/object/object.cpp:1034–1050  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1032}
1033
1034void Object::set_script_instance(ScriptInstance *p_instance) {
1035 if (script_instance == p_instance) {
1036 return;
1037 }
1038
1039 if (script_instance) {
1040 memdelete(script_instance);
1041 }
1042
1043 script_instance = p_instance;
1044
1045 if (p_instance) {
1046 script = p_instance->get_script();
1047 } else {
1048 script = Variant();
1049 }
1050}
1051
1052Variant Object::get_script() const {
1053 return script;

Calls 3

memdeleteFunction · 0.85
VariantClass · 0.50
get_scriptMethod · 0.45

Tested by

no test coverage detected