コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: CTableUtility.cs プロジェクト: jasonyyl/Tools
        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);
        }
コード例 #3
0
 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);
 }
コード例 #4
0
ファイル: CTableUtility.cs プロジェクト: jasonyyl/Tools
 public virtual bool SerializeTo(ggc.Foundation.CStream stream)
 {
     stream.WriteT(Version);
     return(true);
 }