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

Method _set_object_property

scene/debugger/scene_debugger.cpp:652–674  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

650}
651
652void SceneDebugger::_set_object_property(ObjectID p_id, const String &p_property, const Variant &p_value, const String &p_field) {
653 Object *obj = ObjectDB::get_instance(p_id);
654 if (!obj) {
655 return;
656 }
657
658 String prop_name = p_property;
659 if (p_property.begins_with("Members/")) {
660 Vector<String> ss = p_property.split("/");
661 prop_name = ss[ss.size() - 1];
662 }
663
664 Variant value;
665 if (p_field.is_empty()) {
666 // Whole value.
667 value = p_value;
668 } else {
669 // Only one field.
670 value = fieldwise_assign(obj->get(prop_name), p_value, p_field);
671 }
672
673 obj->set(prop_name, value);
674}
675
676void SceneDebugger::_next_frame() {
677 SceneTree *scene_tree = SceneTree::get_singleton();

Callers

nothing calls this directly

Calls 7

fieldwise_assignFunction · 0.85
begins_withMethod · 0.80
splitMethod · 0.80
sizeMethod · 0.65
is_emptyMethod · 0.45
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected