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`).
This commit is contained in:
Rindbee
2023-07-08 19:38:27 +08:00
parent f7bc653cbe
commit 4795c3cdfa
4 changed files with 20 additions and 6 deletions

View File

@ -70,6 +70,8 @@ class ViewportTexture : public Texture2D {
protected:
static void _bind_methods();
virtual void reset_local_to_scene() override;
public:
void set_viewport_path_in_scene(const NodePath &p_path);
NodePath get_viewport_path_in_scene() const;