forked from googlearchive/soundstagevr
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto zip Examples and Samples at build time and put into StreamingAss…
…ets, at run-time initialization extract Examples and Samples into Persistent Data Directory if the Examples or Samples directory do not exist. No more manual copying of files. Credit goes to https://forum.unity.com/threads/copying-everyhting-under-streamingassets-to-persistentdatapath-on-android.431269/
- Loading branch information
1 parent
56c88ad
commit aa998cd
Showing
14 changed files
with
2,096 additions
and
1,608 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#if UNITY_EDITOR | ||
|
||
using UnityEngine; | ||
using UnityEditor; | ||
using UnityEditor.Build; | ||
using System.IO; | ||
using ICSharpCode.SharpZipLib.Core; | ||
using ICSharpCode.SharpZipLib.Zip; | ||
|
||
|
||
class CustomBuildPreProcess : IPreprocessBuild | ||
{ | ||
public int callbackOrder { get { return 0; } } | ||
public void OnPreprocessBuild(BuildTarget target, string path) { | ||
|
||
string dataDirectory = Application.dataPath + "/Plugins/Android/assets/Examples/"; | ||
string fileToCreate = Application.streamingAssetsPath + "/Examples.tgz"; | ||
|
||
Utility_SharpZipCommands.CreateTarGZ_FromDirectory (fileToCreate, dataDirectory); | ||
|
||
dataDirectory = Application.dataPath + "/Plugins/Android/assets/Samples/"; | ||
fileToCreate = Application.streamingAssetsPath + "/Samples.tgz"; | ||
|
||
Utility_SharpZipCommands.CreateTarGZ_FromDirectory (fileToCreate, dataDirectory); | ||
|
||
} | ||
} | ||
|
||
#endif |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.