示例#1
0
        void Parse(Stream s)
        {
            var br = new BinaryReader(s);

            this.version        = br.ReadUInt32();
            this.unknown1       = br.ReadUInt32();
            this.duration       = br.ReadSingle();
            this.unknown_floats = new float[8];
            for (int i = 0; i < this.unknown_floats.Length; i++)
            {
                this.unknown_floats[i] = br.ReadSingle();
            }
            this.unknown_hashes = new uint[3];

            for (int i = 0; i < this.unknown_hashes.Length; i++)
            {
                this.unknown_hashes[i] = br.ReadUInt32();
            }
            this.clip_name  = br.ReadString32();
            this.actor_name = br.ReadString32();
            var extra_actor_count = br.ReadInt32();
            var extra_actors      = new string[extra_actor_count];

            for (int i = 0; i < extra_actor_count; i++)
            {
                extra_actors[i] = br.ReadString32();
            }
            this.actor_list = string.Join(",", extra_actors);
            var ik_target_count = br.ReadInt32();

            this.IKChainCount = br.ReadInt32();
            var ik_targets = new IKTarget[ik_target_count];

            for (int i = 0; i < ik_target_count; i++)
            {
                ik_targets[i] = new IKTarget(RecommendedApiVersion, this.OnResourceChanged, s);
            }
            this.ik_targets = new IKTargetList(this.OnResourceChanged, ik_targets);
            UInt32 next   = br.ReadUInt32();
            bool   end    = false;
            var    events = new List <ClipEvent>();

            while (stream.Position + next != stream.Length)
            {
                var evt = ClipEvent.Create(next, this.OnResourceChanged, next);

                var evt_end = br.ReadInt32() + br.BaseStream.Position;
                evt.Parse(s);
                events.Add(evt);
                if (Settings.Settings.Checking && br.BaseStream.Position != evt_end)
                {
                    throw new InvalidDataException();
                }

                next = br.ReadUInt32();
            }
            this.clip_events = new ClipEventList(this.OnResourceChanged, events);
            this.s3clip      = new byte[next];
            s.Read(this.s3clip, 0, this.s3clip.Length);
        }
示例#2
0
 public ClipResource(int apiVersion)
     : base(apiVersion, null)
 {
     this.ik_targets  = new IKTargetList(this.OnResourceChanged);
     this.clip_events = new ClipEventList(this.OnResourceChanged);
 }