Fix directory intialization

This commit is contained in:
nlitkowski 2021-12-19 23:39:03 +01:00
parent 7cea4cd4e8
commit 7ed2f43346

View File

@ -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