Created
March 9, 2017 21:09
-
-
Save taibenvenuti/84cc178c8ed4a53251934032c8fcd3c5 to your computer and use it in GitHub Desktop.
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
public static void LoadAllShaders() | |
{ | |
var path1 = Path.Combine(DataLocation.localApplicationData, "sunshaftsshader"); | |
var path2 = Path.Combine(DataLocation.localApplicationData, "simpleclearshader"); | |
var loadBundleRequest = WWW.LoadFromCacheOrDownload(Path.Combine("file://", path1), 0); | |
var loadedBundle = loadBundleRequest?.assetBundle; | |
var loadAssetsRequest = loadedBundle.LoadAsset("SunShaftsComposite.shader", typeof(GameObject)); | |
SimpleClearShader.shader = loadAssetsRequest as Shader; | |
Instantiate(SimpleClearShader.shader); | |
loadedBundle.Unload(false); | |
loadBundleRequest.Dispose(); | |
loadBundleRequest = WWW.LoadFromCacheOrDownload(Path.Combine("file://", path2), 0); | |
loadedBundle = loadBundleRequest?.assetBundle; | |
loadAssetsRequest = loadedBundle.LoadAsset("SimpleClear.shader", typeof(GameObject)); | |
SimpleClearShader.shader = loadAssetsRequest as Shader; | |
Instantiate(SimpleClearShader.shader); | |
loadedBundle.Unload(false); | |
loadBundleRequest.Dispose(); | |
Debug.Log("Loaded bundles"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment