Skip to content

Commit 6eef4e4

Browse files
create directory before lock file
(cherry picked from commit 357b3db)
1 parent c28fb0d commit 6eef4e4

File tree

1 file changed

+26
-17
lines changed

1 file changed

+26
-17
lines changed

Assets/Scripts/Web/Config.cs

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ private static void Initialize()
9595
if (!Application.isEditor)
9696
{
9797
ParseCommandLine();
98+
}
99+
100+
CreatePersistentPath();
101+
102+
if (!Application.isEditor)
103+
{
98104
CreateLockFile();
99105
}
100106

@@ -107,23 +113,6 @@ private static void Initialize()
107113
LoadExternalAssets();
108114
Sensors = SensorTypes.ListSensorFields(SensorPrefabs);
109115

110-
if (!Directory.Exists(PersistentDataPath))
111-
{
112-
try
113-
{
114-
Directory.CreateDirectory(PersistentDataPath);
115-
}
116-
catch
117-
{
118-
Debug.LogError($"Cannot create directory at {PersistentDataPath}");
119-
#if UNITY_EDITOR
120-
UnityEditor.EditorApplication.isPlaying = false;
121-
#else
122-
Application.Quit(1);
123-
#endif
124-
}
125-
}
126-
127116
DatabaseManager.Init();
128117

129118
ClientSettingsService csservice = new ClientSettingsService();
@@ -777,6 +766,26 @@ private static void ParseCommandLine()
777766
}
778767
}
779768

769+
static void CreatePersistentPath()
770+
{
771+
if (!Directory.Exists(PersistentDataPath))
772+
{
773+
try
774+
{
775+
Directory.CreateDirectory(PersistentDataPath);
776+
}
777+
catch
778+
{
779+
Debug.LogError($"Cannot create directory at {PersistentDataPath}");
780+
#if UNITY_EDITOR
781+
UnityEditor.EditorApplication.isPlaying = false;
782+
#else
783+
Application.Quit(1);
784+
#endif
785+
}
786+
}
787+
}
788+
780789
static void CreateLockFile()
781790
{
782791
try

0 commit comments

Comments
 (0)