Esempio n. 1
0
        public int InstanceAssetAsync(
            string address,
            OnAssetProgress progressCallback,
            OnAssetComplete completeCallback,
            AsyncPriority priority,
            SystemObject userdata)
        {
            string path = assetDetailConfig.GetPathByAddress(address);

            return(RequestAssetsAsync(new string[] { address }, new string[] { path }, true, progressCallback, completeCallback, null, null, priority, userdata));
        }
Esempio n. 2
0
 public int InstanceAssetsAsync(
     string[] addresses,
     OnAssetProgress progressCallback,
     OnAssetComplete completeCallback,
     OnAssetsProgress progressesCallback,
     OnAssetsComplete completesCallback,
     AsyncPriority priority,
     SystemObject userdata)
 {
     string[] paths = assetDetailConfig.GetPathsByAddresses(addresses);
     return(RequestAssetsAsync(addresses, paths, true, progressCallback, completeCallback, progressesCallback, completesCallback, priority, userdata));
 }
 public static int InstanceAssetAsync(
     string address,
     OnAssetProgress progressCallback,
     OnAssetComplete completeCallback,
     AsyncPriority priority = AsyncPriority.Default,
     SystemObject userdata  = null)
 {
     if (loader != null)
     {
         return(loader.InstanceAssetAsync(address, progressCallback, completeCallback, priority, userdata));
     }
     return(-1);
 }
 public static int InstanceAssetsAsyncByLabel(
     string label,
     OnAssetProgress progressCallback,
     OnAssetComplete completeCallback,
     OnAssetsProgress progressesCallback,
     OnAssetsComplete completesCallback,
     AsyncPriority priority = AsyncPriority.Default,
     SystemObject userdata  = null)
 {
     if (loader != null)
     {
         return(loader.InstanceAssetsAsyncByLabel(label, progressCallback, completeCallback, progressesCallback, completesCallback, priority, userdata));
     }
     return(-1);
 }
        public void OnRelease()
        {
            id                 = -1;
            state              = RequestState.None;
            addresses          = null;
            paths              = null;
            isInstance         = false;
            progressCallback   = null;
            completeCallback   = null;
            progressesCallback = null;
            completesCallback  = null;
            priority           = AsyncPriority.Default;
            userdata           = null;

            result = null;
        }
Esempio n. 6
0
 public int InstanceAssetsAsyncByLabel(
     string label,
     OnAssetProgress progressCallback,
     OnAssetComplete completeCallback,
     OnAssetsProgress progressesCallback,
     OnAssetsComplete completesCallback,
     AsyncPriority priority,
     SystemObject userdata)
 {
     string[] addresses = assetDetailConfig.GetAddressesByLabel(label);
     if (addresses == null || addresses.Length == 0)
     {
         throw new Exception();
     }
     string[] paths = assetDetailConfig.GetPathsByAddresses(addresses);
     return(RequestAssetsAsync(addresses, paths, true, progressCallback, completeCallback, progressesCallback, completesCallback, priority, userdata));
 }
Esempio n. 7
0
        private int RequestAssetsAsync(
            string[] addresses,
            string[] paths,
            bool isInstance,
            OnAssetProgress progressCallback,
            OnAssetComplete completeCallback,
            OnAssetsProgress progressesCallback,
            OnAssetsComplete completesCallback,
            AsyncPriority priority,
            SystemObject userdata)
        {
            int          id      = uniqueIDCreator.GetNextID();
            AsyncRequest request = requestPool.Get();

            request.id                 = id;
            request.addresses          = addresses;
            request.paths              = paths;
            request.isInstance         = isInstance;
            request.progressCallback   = progressCallback;
            request.completeCallback   = completeCallback;
            request.progressesCallback = progressesCallback;
            request.completesCallback  = completesCallback;
            request.priority           = priority;
            request.userdata           = userdata;
            request.state              = RequestState.WaitingForStart;

            AsyncResult result = resultPool.Get();

            result.DoInitialize(id, addresses);
            resultDic.Add(id, result);

            request.result = result;

            requestDic.Add(id, request);
            waitingRequestQueue.Enqueue(request, request.priority);

            return(id);
        }