void ReadCustomSaveData(IAdvCustomSaveDataIO io) { if (Buffers.ContainsKey(io.SaveKey)) { BinaryUtil.BinaryRead(Buffers[io.SaveKey], io.OnRead); } }
void WriteCustomSaveData(IAdvCustomSaveDataIO io) { if (Buffers.ContainsKey(io.SaveKey)) { Debug.LogError(string.Format("Custom save data[{0}] is already exsits. Please use another key.", io.SaveKey)); return; } byte[] buffer = BinaryUtil.BinaryWrite(io.OnWrite); Buffers.Add(io.SaveKey, buffer); }