diff options
author | Rindbee <idleman@yeah.net> | 2023-07-08 19:38:27 +0800 |
---|---|---|
committer | Rindbee <idleman@yeah.net> | 2023-08-08 23:49:53 +0800 |
commit | 4795c3cdfa5cebaaee6c5ca0ea070d0e7c4305e4 (patch) | |
tree | e884f82250036e90944bd6411089b34cbfd79e0a /scene/main/viewport.h | |
parent | f7bc653cbe81018fe362472a0143b7153a52f929 (diff) | |
download | redot-engine-4795c3cdfa5cebaaee6c5ca0ea070d0e7c4305e4.tar.gz |
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`).
Diffstat (limited to 'scene/main/viewport.h')
-rw-r--r-- | scene/main/viewport.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/scene/main/viewport.h b/scene/main/viewport.h index 331ce98cdd..271129e8fc 100644 --- a/scene/main/viewport.h +++ b/scene/main/viewport.h @@ -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; |