public bool SaveToBinary(string tablePath) { int buffSize = 8 * 1024 * 1024; byte[] buff = new byte[buffSize]; ggc.Foundation.CStream stream = new ggc.Foundation.CStream(buff, 0); // 1. Get Version to stream stream.WriteT(CFxsTableInfo.TableInfoVer); // 2. Write entries to stream stream.WriteT(m_mapFxsTableInfos.Count); foreach (var keyValuePair in m_mapFxsTableInfos) { var entry = keyValuePair.Value; if (!entry.SerializeTo(stream)) { ggc.Foundation.Log.LogErrorMsg("Fail to Serialize " + TableName); return(false); } } // 3. write to file System.IO.FileStream fs = new System.IO.FileStream(tablePath + TableName, System.IO.FileMode.Create, System.IO.FileAccess.Write); System.IO.BinaryWriter writer = new System.IO.BinaryWriter(fs); writer.Write(stream.ByteData, 0, (int)stream.TotalSizeWritten()); writer.Close(); fs.Close(); return(true); }
public float BlendTime; // blend time #region ISerializable public virtual bool SerializeTo(ggc.Foundation.CStream stream) { stream.WriteT(StartTime); stream.WriteT(EndTime); stream.WriteT(Movement); stream.WriteT(BlendTime); return(true); }
public override bool SerializeTo(ggc.Foundation.CStream stream) { base.SerializeTo(stream); stream.WriteT(m_ID); stream.WriteT(m_Fx); stream.WriteT(m_LoopType); stream.WriteT(m_IsAttach); stream.WriteT(m_CameraType); stream.WriteT(m_Duration); stream.WriteT(m_Scale); stream.WriteT(m_IsStop); stream.WriteT(m_Bone); stream.WriteT(m_Offset); stream.WriteT(m_Rotate); return(true); }
public virtual bool SerializeTo(ggc.Foundation.CStream stream) { stream.WriteT(Version); return(true); }