SHARE
TWEET

Untitled

a guest May 22nd, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         private IEnumerator LoadBundleFromLocal(string path, Action<AssetBundle> onComplete) {
  2.             var asyncLoad =
  3.                 AssetBundle.LoadFromFileAsync(path);
  4.  
  5.             while (!asyncLoad.isDone) {
  6.                 yield return null;
  7.             }
  8.  
  9.             onComplete(asyncLoad.assetBundle);
  10.         }
  11.  
  12.  
  13.  
  14.  
  15.  
  16. StartCoroutine(LoadBundleFromLocal(url, bundle => {
  17.                             // коллбэк тут
  18.                             if (bundle == null) {
  19.                                 Log.D($"Failed to load \"{bundleName}\" AssetBundle!");
  20.                             } else {
  21.                                 Log.D($"Bundle \"{bundleName}\" got!");
  22.                 }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top