예제 #1
0
        public AssetLoadRequest LoadFromWeb(string group, UnityEngine.Networking.UnityWebRequest webReq
                                            , GameObject autoRefGameObject    = null
                                            , AssetLoadRequest.OnCompleted cb = null
                                            , int priority = AssetLoadRequest.Priority_Common
                                            )
        {
            if (priority <= AssetLoadRequest.Priority_Fast)
            {
                throw new Exception("Load From web not support sync mode." + webReq.url);
            }
            AssetLoadRequest req = AssetLoadRequest.Get();

            req.url = webReq.url;
            req.autoRefGameObject = autoRefGameObject;
            req.priority          = priority;
            req.onCompleted       = cb;
            req.AttachData("__webReq", webReq);
            req.AttachData("__webGroup", group);
            StartLoad(req);
            return(req);
        }
예제 #2
0
        public AssetLoadRequest LoadWebTexture(string group, string url
                                               , GameObject autoRefGameObject    = null
                                               , AssetLoadRequest.OnCompleted cb = null
                                               , int priority = AssetLoadRequest.Priority_Common)
        {
            if (priority <= AssetLoadRequest.Priority_Fast)
            {
                throw new Exception("Load From web not support sync mode." + url);
            }
            AssetLoadRequest req = AssetLoadRequest.Get();

            req.url = url;
            req.autoRefGameObject = autoRefGameObject;
            req.priority          = priority;
            req.type        = typeof(Texture2D);
            req.onCompleted = cb;
            req.AttachData("__webGroup", group);
            StartLoad(req);
            return(req);
        }