diff --git a/SW-Unity/Assets/Scripts/Main.cs b/SW-Unity/Assets/Scripts/Main.cs index 0032a805..8bf2517e 100644 --- a/SW-Unity/Assets/Scripts/Main.cs +++ b/SW-Unity/Assets/Scripts/Main.cs @@ -7,7 +7,7 @@ using UnityEngine; public class Main : MonoBehaviour { #region Constants - readonly string capturedFramesPath = Path.Combine(Application.dataPath, "..", "..", "capturedframe"); + string capturedFramesPath = Path.Combine(Application.dataPath, "..", "..", "Trees"); #endregion #region Camera GUI fields @@ -141,6 +141,8 @@ public class Main : MonoBehaviour } } + capturedFramesPath = Path.Combine(capturedFramesPath, tree1.name); + bool exists = Directory.Exists(capturedFramesPath); if (!exists) Directory.CreateDirectory(capturedFramesPath); @@ -348,7 +350,7 @@ public class Main : MonoBehaviour RenderTexture.active = currentRT; ++FrameCounter; - string path = Path.Combine(capturedFramesPath, tree1.name + "-" + FrameCounter.ToString() + ".png"); + string path = Path.Combine(capturedFramesPath, FrameCounter.ToString() + ".png"); byte[] bytes = offscreenTexture.EncodeToPNG(); File.WriteAllBytes(path, bytes); Debug.Log(path);