public static void Save(OCIChar _ociChar, string _name) { string path = UserData.Create("studio/pose") + Utility.GetCurrentTime() + ".dat"; PauseCtrl.FileInfo fileInfo = new PauseCtrl.FileInfo(_ociChar); using (FileStream fileStream = new FileStream(path, FileMode.Create, FileAccess.Write)) { using (BinaryWriter _writer = new BinaryWriter((Stream)fileStream)) { _writer.Write("【pose】"); _writer.Write(101); _writer.Write(_ociChar.oiCharInfo.sex); _writer.Write(_name); fileInfo.Save(_writer); } } }
public static bool Load(OCIChar _ociChar, string _path) { PauseCtrl.FileInfo fileInfo = new PauseCtrl.FileInfo((OCIChar)null); using (FileStream fileStream = new FileStream(_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) { using (BinaryReader _reader = new BinaryReader((Stream)fileStream)) { if (string.Compare(_reader.ReadString(), "【pose】") != 0) { return(false); } int _ver = _reader.ReadInt32(); _reader.ReadInt32(); _reader.ReadString(); fileInfo.Load(_reader, _ver); } } fileInfo.Apply(_ociChar); return(true); }