diff --git a/Assets/Scripts/InteractionEngine/CommunicationEvents.cs b/Assets/Scripts/InteractionEngine/CommunicationEvents.cs index 0f349447603467875e7caae942f0bd7ec3ff9b38..70867258877dfc8d8a2c01a53f81b49c7a031262 100644 --- a/Assets/Scripts/InteractionEngine/CommunicationEvents.cs +++ b/Assets/Scripts/InteractionEngine/CommunicationEvents.cs @@ -109,8 +109,10 @@ public static string CreateHierarchiePath(List<Directories> hierarchie, string p public static string Get_DataPath() { + bool use_replacementfolder = false; + if (Application.isEditor) - return Path.Combine(Application.dataPath, "StreamingAssets", "StreamToDataPath_withHandler"); + return use_replacementfolder ? Path.Combine(Application.persistentDataPath, "DataPath_writeable") : Path.Combine(Application.dataPath, "StreamingAssets", "StreamToDataPath_withHandler"); return Opsys switch { diff --git a/Assets/Scripts/Loading/StreamingAssetLoader.cs b/Assets/Scripts/Loading/StreamingAssetLoader.cs index ac80d957e30c30bec32c5648ce17bdb398e2941d..0f5d00a1a2f6012347fa190ff88664de463e3cba 100644 --- a/Assets/Scripts/Loading/StreamingAssetLoader.cs +++ b/Assets/Scripts/Loading/StreamingAssetLoader.cs @@ -232,9 +232,10 @@ public static void RereadFiles_DataPath() //Debug.Log("Reread_DataPath"); string rootPath = Path.Combine(Application.streamingAssetsPath, StreamToDataPath_Folder); string targetFolder = Application.dataPath; - if (Application.isEditor) + bool useReplacementFolderWhenInEditor = false; + if (Application.isEditor && useReplacementFolderWhenInEditor) { - Get_DataPath(); + targetFolder = Get_DataPath(); } RereadFiles_DataPath_withHandler(); diff --git a/Assets/StreamingAssets/README_StreamingAssets.md b/Assets/StreamingAssets/README_StreamingAssets.md index 3325745a1d26888a2e2212bce1dd9fea3d6a5523..980068a0f649c1f062a2d37a389a3533b346e8cc 100644 --- a/Assets/StreamingAssets/README_StreamingAssets.md +++ b/Assets/StreamingAssets/README_StreamingAssets.md @@ -1,18 +1,11 @@ ## Info: For OperatingSystem Android: please register all Files in StreamingAssetLoader! - -## StreamToDataPath: -All files and subfolders will be copied to DataPath. -Will be triggered on each start of the game. -Exception: Files with "meta" in the name. - ## StreamToPersistentDataPath: All files and subfolders will be copied to PersistentDataPath. Will be triggered on first time installing the game or with the corresponding restart buttons. Exception: Files with "meta" in the name. - ## StreamToDataPath_withHandler: If Operatingsystem is Android, then: - All files and subfolders will be copied to PersistentDataPath. @@ -20,3 +13,10 @@ If Operatingsystem is Android, then: If Operatingsystem is other than Android, then: - All files and subfolders will be copied to DataPath. - Exception: Files with "meta" in the name. + +## StreamToDataPath: +All files and subfolders will be copied to DataPath. +Will be triggered on each start of the game. +Exception: Files with "meta" in the name. +-> Use StreamToDataPath only for debugging. +-> Otherwise use StreamToDataPath_withHandler \ No newline at end of file