Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private IEnumerator LoadBundleFromLocal(string path, Action<AssetBundle> onComplete) {
- var asyncLoad =
- AssetBundle.LoadFromFileAsync(path);
- while (!asyncLoad.isDone) {
- yield return null;
- }
- onComplete(asyncLoad.assetBundle);
- }
- StartCoroutine(LoadBundleFromLocal(url, bundle => {
- // коллбэк тут
- if (bundle == null) {
- Log.D($"Failed to load \"{bundleName}\" AssetBundle!");
- } else {
- Log.D($"Bundle \"{bundleName}\" got!");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement