diff --git a/SW-Unity/Assets/Scripts/Main.cs b/SW-Unity/Assets/Scripts/Main.cs index 8bf2517e..ea1d1dba 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 - string capturedFramesPath = Path.Combine(Application.dataPath, "..", "..", "Trees"); + string capturedFramesPath; #endregion #region Camera GUI fields @@ -141,11 +141,12 @@ public class Main : MonoBehaviour } } - capturedFramesPath = Path.Combine(capturedFramesPath, tree1.name); - - bool exists = Directory.Exists(capturedFramesPath); - if (!exists) Directory.CreateDirectory(capturedFramesPath); + capturedFramesPath = Path.Combine(Application.dataPath, "..", "..", "Trees", tree1.name); + if (!Directory.Exists(capturedFramesPath)) + { + Directory.CreateDirectory(capturedFramesPath); + } //--------------------------------------------------------------------------------------------------------------------- //ground