Example #1
0
 public IWWWMgr GetWWWMgr()
 {
     if (mWWWMgr == null)
     {
         mWWWMgr = new WWWMgr(mAssetPool);
     }
     return(mWWWMgr);
 }
Example #2
0
    private void HandleLoadWWWResAsync <T>(string url, AsynvLoadCallback <T> callback) where T : UnityEngine.Object
    {
        IWWWMgr wwwMgr = GetWWWMgr();

        T asset = wwwMgr.TryLoadFromCache <T>(WWWType.DEFAULT, url);

        if (asset != null && callback != null)
        {
            callback(asset);
            return;
        }
        wwwMgr.BuildRequest(WWWType.DEFAULT, url)
        .SetSuccessCallback(delegate(WWWRequestHandle handle)
        {
            asset = wwwMgr.TryLoadFromCache <T>(WWWType.DEFAULT, url);
            if (callback != null)
            {
                callback(asset);
            }
        }).Get();
    }