Ejemplo n.º 1
0
 public GetIntersightTopSystem()
 {
     ApiInstance = new TopApi(Config);
     MethodName  = "GetTopSystemListWithHttpInfo";
 }
Ejemplo n.º 2
0
 public SetIntersightTopSystem()
 {
     ApiInstance = new TopApi(Config);
     ModelObject = new TopSystem();
     MethodName  = "UpdateTopSystemWithHttpInfo";
 }
Ejemplo n.º 3
0
    /// <summary>
    /// リソースリストチェック
    /// </summary>
    private void CheckResourceList()
    {
#if !USE_ASSETBUNDLE
        this.Login();
        return;
#endif
        //リソースバージョン取得通信
        TopApi.CallTopApi((resourceVersion) =>
        {
            var handle        = new FileDownloadHandle(resourceVersion, "infoList.dat");
            handle.isAutoSave = false;

            //リソースリストダウンロード開始
            var downloader = new FileDownloadManager();
            downloader.Add(handle);
            downloader.DownloadStart();

            //タッチブロック
            SharedUI.Instance.DisableTouch();

            //ダウンロード完了時
            downloader.onCompleted = () =>
            {
                //タッチブロック解除
                SharedUI.Instance.EnableTouch();

                var directory = AssetManager.GetAssetBundleDirectoryPath();

                //旧リソースリスト
                var oldInfoList = new List <AssetBundleInfo>();
                {
                    var path = Path.Combine(directory, handle.hash);
                    if (File.Exists(path))
                    {
                        var bytes = File.ReadAllBytes(path).Cryption();
                        oldInfoList.AddRange(BinaryUtility.CreateArray <AssetBundleInfo>(bytes));
                    }
                }

                //新リソースリスト
                var newInfoList = new List <AssetBundleInfo>();
                {
                    var bytes = handle.bytes.Cryption();
                    newInfoList.AddRange(BinaryUtility.CreateArray <AssetBundleInfo>(bytes));
                }

                //ダウンロード対象
                var targetInfoList = new List <AssetBundleInfo>();

                for (int i = 0; i < newInfoList.Count; i++)
                {
                    var targetInfo = newInfoList[i];
                    var filePath   = Path.Combine(directory, targetInfo.assetBundleName.GetHashString());

                    //既存ファイルの場合
                    if (File.Exists(filePath))
                    {
                        //CRC値が同じならダウンロードの必要無し
                        var oldInfo = oldInfoList.Find(x => x.assetBundleName == targetInfo.assetBundleName);
                        if (oldInfo != null && oldInfo.crc == targetInfo.crc)
                        {
                            continue;
                        }
                    }

                    //ダウンロード対象として追加
                    targetInfoList.Add(targetInfo);
                }

                //ダウンロードする必要があるなら
                if (targetInfoList.Count > 0)
                {
                    //確認ダイアログ表示
                    this.OpenDownlodConfirmDialog(targetInfoList, () =>
                    {
                        //ダウンロード開始
                        var dialog  = SharedUI.Instance.ShowSimpleDialog();
                        var content = dialog.AddContent(this.downloadDialogContentPrefab);
                        content.Setup(dialog, resourceVersion, oldInfoList, handle, targetInfoList);

                        //ダウンロード終わったら
                        dialog.onClose = () =>
                        {
                            //アセットバンドル情報のセット
                            AssetManager.SetAssetBundleInfoList(newInfoList);
                            //ログイン
                            this.Login();
                        };
                    });
                }
                else
                {
                    //アセットバンドル情報のセット
                    AssetManager.SetAssetBundleInfoList(newInfoList);
                    //ログイン
                    this.Login();
                }
            };
        });
    }