コード例 #1
0
        internal void Read(BinaryReader reader)
        {
            int version = reader.ReadInt32();

            if (version <= Version)
            {
                int count = reader.ReadInt32();
                for (int i = 0; i < count; i++)
                {
                    string key    = reader.ReadString();
                    byte[] buffer = BinaryUtil.ReadBytes(reader);
                    if (Tbl.ContainsKey(key))
                    {
                        BinaryUtil.BinaryRead(buffer, Tbl[key].Read);
                    }
                    else
                    {
                        //セーブされていたが、パラメーター設定から消えているので読み込まない
                    }
                }
            }
            else
            {
                Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.UnknownVersion, version));
            }
        }
コード例 #2
0
ファイル: AdvCustomSaveData.cs プロジェクト: TUmedu/Utage-GVR
 void ReadCustomSaveData(IAdvCustomSaveDataIO io)
 {
     if (Buffers.ContainsKey(io.SaveKey))
     {
         BinaryUtil.BinaryRead(Buffers[io.SaveKey], io.OnRead);
     }
 }
コード例 #3
0
        //読み込み
        public virtual void OnRead(System.IO.BinaryReader reader)
        {
            //バージョンチェック
            int version = reader.ReadInt32();

            if (version == Version)
            {
                List <string> nameList = new List <string>();
                int           count    = reader.ReadInt32();
                for (int i = 0; i < count; ++i)
                {
                    string key    = reader.ReadString();
                    byte[] buffer = reader.ReadBytes(reader.ReadInt32());
                    nameList.Add(key);
                    BinaryUtil.BinaryRead(buffer, FindWindow(key).ReadPageData);
                }
                string currentWindowName = reader.ReadString();

                ChangeActiveWindows(nameList);
                ChangeCurrentWindow(currentWindowName);
            }
            else
            {
                Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.UnknownVersion, version));
            }
        }
コード例 #4
0
        public virtual void OnRead(BinaryReader reader)
        {
            int num = reader.ReadInt32();

            if (num == 0)
            {
                List <string> names = new List <string>();
                int           num2  = reader.ReadInt32();
                for (int i = 0; i < num2; i++)
                {
                    string item  = reader.ReadString();
                    byte[] bytes = reader.ReadBytes(reader.ReadInt32());
                    names.Add(item);
                    BinaryUtil.BinaryRead(bytes, new Action <BinaryReader>(this.FindWindow(item).ReadPageData));
                }
                string name = reader.ReadString();
                this.ChangeActiveWindows(names);
                this.ChangeCurrentWindow(name);
            }
            else
            {
                object[] args = new object[] { num };
                Debug.LogError(LanguageErrorMsg.LocalizeTextFormat(ErrorMsg.UnknownVersion, args));
            }
        }
コード例 #5
0
        //ロード処理
        IEnumerator CoLoad(int version, System.Action onComplete)
        {
            foreach (string path in localPathList)
            {
                files.Add(AssetFileManager.Load(FilePathUtil.ToStreamingAssetsPath(path), this));
            }
            foreach (string url in serverUrlList)
            {
                files.Add(AssetFileManager.Load(url, version, this));
            }

            while (IsLoading)
            {
                yield return(0);
            }

            foreach (AssetFile file in files)
            {
                ConvertFileList infoList = new ConvertFileList(file.FileName);
                BinaryUtil.BinaryRead(file.Bytes, infoList.Read);
                infoLists.Add(infoList);
                file.Unuse(this);
            }
            files.Clear();
            IsInitialized = true;
            if (onComplete != null)
            {
                onComplete();
            }
        }
コード例 #6
0
 //データ読み込み
 public void Overrirde(T io)
 {
     if (Buffers.ContainsKey(io.SaveKey))
     {
         BinaryUtil.BinaryRead(Buffers[io.SaveKey], io.OnRead);
     }
     else
     {
         Debug.LogError(string.Format("Not found Save data Key [{0}] ", io.SaveKey));
     }
 }
コード例 #7
0
 public void Overrirde(IBinaryIO io)
 {
     if (this.Buffers.ContainsKey(io.SaveKey))
     {
         BinaryUtil.BinaryRead(this.Buffers[io.SaveKey], new Action <BinaryReader>(io.OnRead));
     }
     else
     {
         Debug.LogError(string.Format("Not found Save data Key [{0}] ", io.SaveKey));
     }
 }
コード例 #8
0
 //セーブデータ用のバイナリ読み込み
 public void Read(byte[] buffer, AdvGraphicInfo graphic)
 {
     this.TargetObject.gameObject.SetActive(false);
     Loader.LoadGraphic(
         graphic,
         () =>
     {
         this.TargetObject.gameObject.SetActive(true);
         SetGraphicOnSaveDataRead(graphic);
         BinaryUtil.BinaryRead(buffer, Read);
     }
         );
 }
コード例 #9
0
        //コンバートファイルリストのファイルを読み込む
        void Read()
        {
            //出力先のアセットバンドル情報を読み込む
            string convertFileListPath = FilePathUtil.Combine(OutputResourcesPath, Path.GetFileNameWithoutExtension(OutputResourcesPath) + ExtensionUtil.ConvertFileList);

            convertFileListPath += ExtensionUtil.UtageFile;
            ConvertFileList      = new ConvertFileList(convertFileListPath);
            //ファイルから読み込む
            if (File.Exists(convertFileListPath))
            {
                byte[] bytes = File.ReadAllBytes(convertFileListPath);
                bytes = FileIOManager.Decode(bytes);
                BinaryUtil.BinaryRead(bytes, ConvertFileList.Read);
            }
        }
コード例 #10
0
ファイル: AdvScenarioPlayer.cs プロジェクト: TUmedu/Utage-GVR
 internal void StartSaveData(AdvSaveData saveData)
 {
     Clear();
     this.isEndScenario = false;
     //現在のシーン回想登録用のラベルを記録
     this.currentGallerySceneLabel = saveData.CurrentGallerySceneLabel;
     //古いセーブデータかを設定しておく
     this.IsOldVersion = (saveData.FileVersion <= AdvSaveData.Version2);
     //ジャンプマネージャーを初期化
     BinaryUtil.BinaryRead(saveData.JumpMangerBuffer, (x) => this.JumpManager.Read(Engine, x));
     //バージョンアップ用のセーブデータ
     saveData.VersionUpBuffer.ReadCustomSaveData(Engine.SaveManager.GetVersionUpSaveIoListCreateIfMissing(Engine));
     //カスタムセーブデータ
     saveData.CustomBuffer.ReadCustomSaveData(Engine.SaveManager.CustomSaveDataIOList);
     //シナリオ開始
     StartCoroutine(CoStartScenario(saveData.CurrentSenarioLabel, saveData.CurrentPage, null));
 }
コード例 #11
0
        //コンバートファイルリストのファイルを読み込む
        void Read()
        {
            //出力先のアセットバンドル情報を読み込む
            string convertFileListPath = FilePathUtil.Combine(OutputResourcesPath, Path.GetFileNameWithoutExtension(OutputResourcesPath) + ExtensionUtil.ConvertFileList);
            bool   isEncoded           = Settings.FindSettingFromPath(convertFileListPath).EncodeType == AssetFileEncodeType.AlreadyEncoded;

            if (isEncoded)
            {
                convertFileListPath += ExtensionUtil.UtageFile;
            }

            ConvertFileList = new ConvertFileList(convertFileListPath);
            //ファイルから読み込む
            if (File.Exists(convertFileListPath))
            {
                byte[] bytes = File.ReadAllBytes(convertFileListPath);
                if (isEncoded)
                {
                    bytes = FileIOManager.Decode(bytes);
                }
                BinaryUtil.BinaryRead(bytes, ConvertFileList.Read);
            }
        }
コード例 #12
0
 internal void ReadSaveDataBuffer(byte[] buffer)
 {
     BinaryUtil.BinaryRead(buffer, Read);
 }
コード例 #13
0
 //バイナリデータを読みこみ
 public virtual void ReadBuffer(byte[] buffer)
 {
     BinaryUtil.BinaryRead(buffer, Read);
 }