Пример #1
0
 public void Read(string path)
 {
     if (!string.IsNullOrEmpty(path))
     {
         using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read))
             using (BinaryReader reader = new BinaryReader(fs))
             {
                 skillHostTrack = reader.ReadUInt16();
                 int cnt = reader.ReadInt32();
                 tracks = new TrackData[cnt];
                 for (int i = 0; i < cnt; i++)
                 {
                     var type = (AssetType)reader.ReadInt32();
                     tracks[i]      = new TrackData();
                     tracks[i].type = type;
                     tracks[i].Read(reader);
                 }
             }
     }
 }
Пример #2
0
        public virtual void Read(BinaryReader reader)
        {
            int len = reader.ReadInt32();

            if (len > 0)
            {
                clips = new ClipData[len];
            }
            int len2 = reader.ReadInt32();

            if (len2 > 0)
            {
                childs = new TrackData[len2];
            }
            int len3 = reader.ReadInt32();

            if (len3 > 0)
            {
                marks = new MarkData[len3];
            }

            for (int j = 0; j < len; j++)
            {
                clips[j] = XTimelineFactory.CreateClipData(reader);
            }
            for (int j = 0; j < len2; j++)
            {
                childs[j]      = new TrackData();
                childs[j].type = (AssetType)reader.ReadInt32();
                childs[j].Read(reader);
            }
            for (int i = 0; i < len3; i++)
            {
                marks[i] = XTimelineFactory.CreateMarkData(reader);
            }
        }