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

Added option for using replacement folder. Use StreamToDataPath only for debugging.

parent 4d1de0bf
No related branches found
No related tags found
No related merge requests found
Pipeline #5976 passed
...@@ -109,8 +109,10 @@ public static string CreateHierarchiePath(List<Directories> hierarchie, string p ...@@ -109,8 +109,10 @@ public static string CreateHierarchiePath(List<Directories> hierarchie, string p
public static string Get_DataPath() public static string Get_DataPath()
{ {
bool use_replacementfolder = false;
if (Application.isEditor) 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 return Opsys switch
{ {
......
...@@ -232,9 +232,10 @@ public static void RereadFiles_DataPath() ...@@ -232,9 +232,10 @@ public static void RereadFiles_DataPath()
//Debug.Log("Reread_DataPath"); //Debug.Log("Reread_DataPath");
string rootPath = Path.Combine(Application.streamingAssetsPath, StreamToDataPath_Folder); string rootPath = Path.Combine(Application.streamingAssetsPath, StreamToDataPath_Folder);
string targetFolder = Application.dataPath; string targetFolder = Application.dataPath;
if (Application.isEditor) bool useReplacementFolderWhenInEditor = false;
if (Application.isEditor && useReplacementFolderWhenInEditor)
{ {
Get_DataPath(); targetFolder = Get_DataPath();
} }
RereadFiles_DataPath_withHandler(); RereadFiles_DataPath_withHandler();
......
## Info: ## Info:
For OperatingSystem Android: please register all Files in StreamingAssetLoader! 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: ## StreamToPersistentDataPath:
All files and subfolders will be copied to PersistentDataPath. All files and subfolders will be copied to PersistentDataPath.
Will be triggered on first time installing the game or with the corresponding restart buttons. Will be triggered on first time installing the game or with the corresponding restart buttons.
Exception: Files with "meta" in the name. Exception: Files with "meta" in the name.
## StreamToDataPath_withHandler: ## StreamToDataPath_withHandler:
If Operatingsystem is Android, then: If Operatingsystem is Android, then:
- All files and subfolders will be copied to PersistentDataPath. - All files and subfolders will be copied to PersistentDataPath.
...@@ -20,3 +13,10 @@ If Operatingsystem is Android, then: ...@@ -20,3 +13,10 @@ If Operatingsystem is Android, then:
If Operatingsystem is other than Android, then: If Operatingsystem is other than Android, then:
- All files and subfolders will be copied to DataPath. - All files and subfolders will be copied to DataPath.
- Exception: Files with "meta" in the name. - 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
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