protected override void InitMainRequest()
        {
            _mainOdrRequest              = ResourceODRLocation.PreloadAsync(new[] { _odrTag });
            _mainOdrRequest.OnCompleted += OnODRRequestCompleted;

            ResourceDebug.Log("{0}->InitMainRequest: odrTag [{1}]", GetType().Name, _odrTag);
        }
Exemplo n.º 2
0
        public static ResourceODRRequest PreloadAsync(string[] tags)
        {
            var isVirtual    = Application.isEditor;
            var downloadTags = isVirtual ? CollectUnDownloadedVirtualTags(tags) : tags;

            var request = new ResourceODRRequest(downloadTags, isVirtual);

            request.OnCompleted += loadRequest => {
                if (loadRequest != request || request.HasError)
                {
                    return;
                }

                if (isVirtual)
                {
                    OnVirtualTagsDownloadFinish(downloadTags);
                }
            };

            return(request);
        }