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); } }
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); }