Skip to content
Snippets Groups Projects
Commit 597ba19b authored by Stefan Richter's avatar Stefan Richter
Browse files

While in UnityEditor: DataPath will now link to PersistentDataPath

parent 6c731523
No related branches found
No related tags found
No related merge requests found
......@@ -17448,7 +17448,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!224 &178559033428688118
RectTransform:
m_ObjectHideFlags: 0
......
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using UnityEngine;
using UnityEngine.Events;
......@@ -125,6 +126,9 @@ public static string CreatePathToFile(out bool file_exists, string name, string
OperationSystem.Windows or _ => use_install_folder ? Application.dataPath : Application.persistentDataPath,
};
string Target_StreamToDataPath_UnityEditor = "UnityEditor";
if (Application.isEditor && use_install_folder) { path = Path.Combine(Application.persistentDataPath, Target_StreamToDataPath_UnityEditor); }
if (hierarchie != null)
{
path = CreateHierarchiePath(hierarchie, path);
......
......@@ -16,6 +16,7 @@ public static class StreamingAssetLoader
public static string StreamToPersistentDataPath_Folder_Cookie = "cookie_persistentDataPath.txt";
public static string StreamToDataPath_withHandler_Folder = "StreamToDataPath_withHandler";
public static string PersDataPathToPlayerSaveGame_Path = "stages/SaveGames";
public static string Target_StreamToDataPath_UnityEditor = "UnityEditor";
//Config
......@@ -72,6 +73,7 @@ public static bool ReloadManualy_StreamToDataPathWithHandler(string TargetDir_1)
//Debug.Log("Reloaded_DPwH");
return true;
}
//---------------------------------------------------------------------------------------
......@@ -229,7 +231,11 @@ public static void RereadFiles_DataPath()
{
//Debug.Log("Reread_DataPath");
string rootPath = Path.Combine(Application.streamingAssetsPath, StreamToDataPath_Folder);
string targetFolder = Application.dataPath;
string targetFolder = Application.dataPath;
if (Application.isEditor)
{
targetFolder = Path.Combine(Application.persistentDataPath, Target_StreamToDataPath_UnityEditor);
}
RereadFiles_DataPath_withHandler();
if (!ReReadFiles(rootPath, targetFolder))
......@@ -250,6 +256,10 @@ public static void RereadFiles_DataPath_withHandler()
targetFolder_wh = Application.persistentDataPath;
//Debug.Log(OperationSystem.Android + " " + targetFolder_wh);
}
if (Application.isEditor)
{
targetFolder_wh = Path.Combine(Application.persistentDataPath, Target_StreamToDataPath_UnityEditor);
}
if (!ReReadFiles(rootPath, targetFolder_wh))
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment