From bda97c25834fbba441f786f24fa41992593b3ca1 Mon Sep 17 00:00:00 2001 From: Nadine Ganz Date: Wed, 26 Mar 2025 15:02:50 +0100 Subject: [PATCH] Destroy textures when slideshow is finished --- Viagg-io/Assets/Scripts/PhotoTransition.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Viagg-io/Assets/Scripts/PhotoTransition.cs b/Viagg-io/Assets/Scripts/PhotoTransition.cs index d37e4ad1..34e12f0e 100644 --- a/Viagg-io/Assets/Scripts/PhotoTransition.cs +++ b/Viagg-io/Assets/Scripts/PhotoTransition.cs @@ -59,6 +59,14 @@ public class PhotoTransition : MonoBehaviour public void Reset() { + foreach (var texture in _imgList) + { + if (texture != null) + { + Destroy(texture); + } + } + _imgList.Clear(); _state = 0; }