Exemple #1
0
        public override void Deserialize(Stream stream)
        {
            base.Deserialize(stream);

            using (var r = stream.ToBinaryReader(true))
            {
                Unk2 = r.ReadSingle();

                uint count = r.ReadUInt32();
                for (int i = 0; i < count; i++)
                {
                    if (Unk2 >= 0.2000000029802322f)
                    {
                        string           name              = r.ReadCString();
                        string           subName           = r.ReadCString();
                        TransformKeyData transformKeyDatas = null;

                        if (string.IsNullOrWhiteSpace(subName))
                        {
                            transformKeyDatas = r.Deserialize <TransformKeyData>();
                        }

                        Animation.Add(Tuple.Create(name, subName, transformKeyDatas));
                    }
                    else
                    {
                        string name = r.ReadCString();
                        Animation.Add(Tuple.Create(name, default(string), r.Deserialize <TransformKeyData>()));
                    }
                }
            }
        }
Exemple #2
0
        public override void Deserialize(Stream stream)
        {
            base.Deserialize(stream);

            using (var r = stream.ToBinaryReader(true))
            {
                Version = r.ReadSingle();

                uint count = r.ReadUInt32();
                for (int i = 0; i < count; i++)
                {
                    if (Version >= 0.2000000029802322f)
                    {
                        string           name             = r.ReadCString();
                        string           subName          = r.ReadCString();
                        TransformKeyData transformKeyData = null;

                        if (string.IsNullOrWhiteSpace(subName))
                        {
                            transformKeyData = r.Deserialize <TransformKeyData>();
                        }

                        Animation.Add(new BoneAnimation {
                            Name = name, Copy = subName, TransformKeyData = transformKeyData
                        });
                    }
                    else
                    {
                        string name = r.ReadCString();
                        Animation.Add(new BoneAnimation {
                            Name = name, Copy = default(string), TransformKeyData = r.Deserialize <TransformKeyData>()
                        });
                    }
                }
            }
        }