1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Improve to_string() and add it to Resource

This commit is contained in:
kobewi
2024-07-07 20:18:35 +02:00
parent 9a5d6d1049
commit e6783dbdd1
13 changed files with 53 additions and 61 deletions

View File

@@ -1044,7 +1044,7 @@ String Object::to_string() {
return ret;
}
}
return "<" + get_class() + "#" + itos(get_instance_id()) + ">";
return _to_string();
}
void Object::set_script_and_instance(const Variant &p_script, ScriptInstance *p_instance) {
@@ -1850,6 +1850,10 @@ void Object::notify_property_list_changed() {
emit_signal(CoreStringName(property_list_changed));
}
String Object::_to_string() {
return "<" + get_class() + "#" + itos(get_instance_id()) + ">";
}
void Object::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_class"), &Object::get_class);
ClassDB::bind_method(D_METHOD("is_class", "class"), &Object::is_class);