create subfolder for standalone

This commit is contained in:
Sinai 2021-03-11 18:40:04 +11:00
parent 7a8b5b50d1
commit 21408993c2
2 changed files with 11 additions and 5 deletions

View File

@ -82,9 +82,9 @@ namespace UnityExplorer
SceneManager.add_sceneLoaded(new Action<Scene, LoadSceneMode>((Scene a, LoadSceneMode b) => { OnSceneLoaded(); })); SceneManager.add_sceneLoaded(new Action<Scene, LoadSceneMode>((Scene a, LoadSceneMode b) => { OnSceneLoaded(); }));
SceneManager.add_activeSceneChanged(new Action<Scene, Scene>((Scene a, Scene b) => { OnSceneLoaded(); })); SceneManager.add_activeSceneChanged(new Action<Scene, Scene>((Scene a, Scene b) => { OnSceneLoaded(); }));
} }
catch (Exception ex) catch
{ {
LogWarning($"Exception setting up Unity event listeners!\r\n{ex}"); // exceptions here are non-fatal, just ignore.
} }
#else #else
Application.logMessageReceived += OnUnityLog; Application.logMessageReceived += OnUnityLog;

View File

@ -45,9 +45,15 @@ namespace UnityExplorer
{ {
if (s_explorerFolder == null) if (s_explorerFolder == null)
{ {
s_explorerFolder = new Uri(Assembly.GetExecutingAssembly().CodeBase).AbsolutePath; s_explorerFolder =
s_explorerFolder = Uri.UnescapeDataString(s_explorerFolder); Path.Combine(
s_explorerFolder = Path.GetDirectoryName(s_explorerFolder); Path.GetDirectoryName(
Uri.UnescapeDataString(new Uri(Assembly.GetExecutingAssembly().CodeBase)
.AbsolutePath)),
"UnityExplorer");
if (!Directory.Exists(s_explorerFolder))
Directory.CreateDirectory(s_explorerFolder);
} }
return s_explorerFolder; return s_explorerFolder;