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)); } }
void ReadCustomSaveData(IAdvCustomSaveDataIO io) { if (Buffers.ContainsKey(io.SaveKey)) { BinaryUtil.BinaryRead(Buffers[io.SaveKey], io.OnRead); } }
//読み込み 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)); } }
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)); } }
//ロード処理 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(); } }
//データ読み込み 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)); } }
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)); } }
//セーブデータ用のバイナリ読み込み 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); } ); }
//コンバートファイルリストのファイルを読み込む 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); } }
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)); }
//コンバートファイルリストのファイルを読み込む 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); } }
internal void ReadSaveDataBuffer(byte[] buffer) { BinaryUtil.BinaryRead(buffer, Read); }
//バイナリデータを読みこみ public virtual void ReadBuffer(byte[] buffer) { BinaryUtil.BinaryRead(buffer, Read); }