Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class LoadFromCacheOrDownloadExample : MonoBehaviour
- {
- IEnumerator Start()
- {
- var www = new WWW("proper/path/to/bundle");
- yield return www;
- // server do not returns error
- if (www.error != null)
- {
- // Unity 5.6b9 debugs this log error(not expected, as 'error' string is null),But not Unity 5.5
- Debug.Log(www.error);
- yield return null;
- }
- if(!string.IsNullOrEmpty(www.error))
- {
- // Both Unity5.6b9 and Unity5.5 do not reach here,as expected obviously
- Debug.Log(www.error);
- }
- var myLoadedAssetBundle = www.assetBundle;
- var asset = myLoadedAssetBundle.mainAsset;
- // Unity 5.6b9 and Unity5.5 reaches here,as expected
- Debug.Log("Bundle Loaded");
- }
- }
Add Comment
Please, Sign In to add comment