You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
Clear the previously set state when configuring for a new scene root node
Saving a subscene causes the main scene to be re-instantiated. And the resource
instance in the main scene will be reused when the main scene is re-instantiated.
So for resources with `resource_local_to_scene` enabled, resetting state may be
necessary (at least for `ViewportTexture`).
(cherry picked from commit 4795c3cdfa)
This commit is contained in:
@@ -226,6 +226,7 @@ void Resource::configure_for_local_scene(Node *p_for_scene, HashMap<Ref<Resource
|
||||
List<PropertyInfo> plist;
|
||||
get_property_list(&plist);
|
||||
|
||||
reset_local_to_scene();
|
||||
local_scene = p_for_scene;
|
||||
|
||||
for (const PropertyInfo &E : plist) {
|
||||
@@ -386,6 +387,10 @@ void Resource::setup_local_to_scene() {
|
||||
emit_signal(SNAME("setup_local_to_scene_requested"));
|
||||
}
|
||||
|
||||
void Resource::reset_local_to_scene() {
|
||||
// Restores the state as if setup_local_to_scene() hadn't been called.
|
||||
}
|
||||
|
||||
Node *(*Resource::_get_local_scene_func)() = nullptr;
|
||||
void (*Resource::_update_configuration_warning)() = nullptr;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user