public void GetResourceByPathAsync(string path, Action <AsyncResource> callBack = null, System.Object param = null, bool loadAll = false)
        {
            var ar = new AsyncResource(path, null, param);

            ar.loadedAsset = Resources.Load(path);
            callBack.Invoke(ar);
        }
        public void GetResourceByPathAsync(List <string> path, Action <Dictionary <string, AsyncResource> > callBack = null, System.Object param = null)
        {
            if (path.Count == 0 ||
                (path.Count == 1 && path[0] == "param"))
            {
                if (callBack != null)
                {
                    Dictionary <string, AsyncResource> nullMap = new Dictionary <string, AsyncResource>();
                    nullMap.Add("param", new AsyncResource("param", null, param));
                    callBack(nullMap);
                }
                return;
            }
            Dictionary <string, AsyncResource> item = new Dictionary <string, AsyncResource>();

            foreach (string resPath in path)
            {
                if (item.ContainsKey(resPath))
                {
                    continue;
                }

                var ar = new AsyncResource(resPath, null, param);
                ar.loadedAsset = Resources.Load(resPath);
                item.Add(resPath, ar);
            }
            callBack(item);
        }
 private void OnPreloadedResource(AsyncResource ar)
 {
     ++m_curPreloaded;
     if (m_onResourcePreloaded != null && ar != null && ar.loadedAsset != null)
     {
         m_onResourcePreloaded.Invoke(ar);
     }
 }
        AsyncResource CreateAsyncResource(string resPath, object param, bool loadAll = false)
        {
            string assetName = null;

            resPath = resPath.ToLower();
            AsyncResource ar = new AsyncResource(resPath, null, param);

            ar.AsyncOp = (string.IsNullOrEmpty(resPath) ? null : Resources.LoadAsync(resPath));
            return(ar);
        }
 public SingleAsyncRes(Action <AsyncResource> callBack, AsyncResource res)
 {
     m_callBack = callBack;
     m_res      = res;
 }
 private static void LoadAssetBundleAsync(string resPath, string assetName, AsyncResource ar, bool loadAll = false)
 {
     ar.isAssetBundleDone = false;
     ar.isLoadAssetBundle = true;
 }