コード例 #1
0
        public void Unserialize(byte animationPhases, Net.InputMessage binaryReader)
        {
            AnimationPhases = animationPhases;
            Async           = binaryReader.GetU8() == 0;
            LoopCount       = binaryReader.GetS32();
            StartPhase      = binaryReader.GetS8();

            for (int i = 0; i < animationPhases; i++)
            {
                var duration = new FrameGroupDuration();
                duration.Minimum = binaryReader.GetS32();
                duration.Maximum = binaryReader.GetS32();

                FrameGroupDurations.Add(duration);
            }
        }
コード例 #2
0
        public static FrameGroupAnimator Serialize(byte animationPhases, ref Net.InputMessage binaryReader)
        {
            FrameGroupAnimator frameGroupAnimator = new FrameGroupAnimator();

            frameGroupAnimator.AnimationPhases = animationPhases;
            frameGroupAnimator.Async           = binaryReader.GetU8() == 0;
            frameGroupAnimator.LoopCount       = binaryReader.GetS32();
            frameGroupAnimator.StartPhase      = binaryReader.GetS8();

            for (int i = 0; i < animationPhases; i++)
            {
                FrameGroupDuration duration = new FrameGroupDuration();
                duration.Minimum = (int)binaryReader.GetU32();
                duration.Maximum = (int)binaryReader.GetU32();

                frameGroupAnimator.FrameGroupDurations.Add(duration);
            }

            return(frameGroupAnimator);
        }