Example #1
0
        private void _CheckPerisitentDataAssetAsync(string path, IAssetDescription description, Action <bool> callback)
        {
            var fullPath = PathUtility.ComposeDataPath(path);

            new FileReadTask(fullPath).Start().Continue(task =>
            {
                var bytes = task.Result as byte[];
                callback(!description.Equals(bytes));

                return(null);
            });
        }
 public static AssetDescription Create(IAssetDescription src)
 {
     return(new AssetDescription
     {
         Id = src.Id,
         AssetId = src.AssetId,
         AssetClass = src.AssetClass,
         Description = src.Description,
         IssuerName = src.IssuerName,
         MarketCapitalization = src.MarketCapitalization,
         NumberOfCoins = src.NumberOfCoins,
         PopIndex = src.PopIndex,
         AssetDescriptionUrl = src.AssetDescriptionUrl,
         FullName = src.FullName
     });
 }
Example #3
0
        private void _CheckStreamingAssetAsync(string path, IAssetDescription description, Action <bool> callback)
        {
            var fullPath = PathUtility.ComposeAppUrl(path);

            new WWWLoadTask(fullPath, 1f).Start().Continue(task =>
            {
                if (null != task.Result)
                {
                    var w = task.Result as WWW;
                    callback(null != w.error || !description.Equals(w.bytes));
                }
                else
                {
                    callback(true);
                }
                return(null);
            });
        }
Example #4
0
 private void _CollectUpgradeAssetAsync(byte loadType, string updateServerPath, IAssetDescription description, Action <Asset> callback)
 {
     if (STREAMINGASSETS == loadType || !File.Exists(PathUtility.ComposeDataPath(description.Path)))
     {
         _CheckStreamingAssetAsync(description.Path, description, result =>
         {
             callback(result ? new Asset(description)
             {
                 ServerPath = updateServerPath,
                 File       = description.Path,
                 Size       = description.Size,
             } : null);
         });
     }
     else
     {
         _CheckPerisitentDataAssetAsync(description.Path, description, result =>
         {
             callback(result ? new Asset(description)
             {
                 ServerPath = updateServerPath,
                 File       = description.Path,
                 Size       = description.Size,
             } : null);
         });
     }
 }
Example #5
0
 public Asset(IAssetDescription description)
 {
     this.description = description;
 }