From 7ed2f433462d2dae06e5dbe91f356306db6e76a6 Mon Sep 17 00:00:00 2001 From: nlitkowski Date: Sun, 19 Dec 2021 23:39:03 +0100 Subject: [PATCH] Fix directory intialization --- SW-Unity/Assets/Scripts/Main.cs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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