public virtual void Load(VMAnimationStateMarshal input) { Anim = FSO.Content.Content.Get().AvatarAnimations.Get(input.Anim + ".anim"); CurrentFrame = input.CurrentFrame; EventCode = input.EventCode; EventFired = input.EventFired; EndReached = input.EndReached; PlayingBackwards = input.PlayingBackwards; Speed = input.Speed; Weight = input.Weight; Loop = input.Loop; }
public override void Deserialize(BinaryReader reader) { base.Deserialize(reader); var anims = reader.ReadInt32(); Animations = new VMAnimationStateMarshal[anims]; for (int i = 0; i < anims; i++) Animations[i] = new VMAnimationStateMarshal(reader); var carry = reader.ReadBoolean(); if (carry) CarryAnimationState = new VMAnimationStateMarshal(reader); Message = reader.ReadString(); MessageTimeout = reader.ReadInt32(); var motCs = reader.ReadInt32(); MotiveChanges = new VMMotiveChange[motCs]; for (int i = 0; i < motCs; i++) { MotiveChanges[i] = new VMMotiveChange(); MotiveChanges[i].Deserialize(reader); } MotiveDecay = new VMAvatarMotiveDecay(); MotiveDecay.Deserialize(reader); var pdats = reader.ReadInt32(); PersonData = new short[pdats]; for (int i = 0; i < pdats; i++) PersonData[i] = reader.ReadInt16(); var mdats = reader.ReadInt32(); MotiveData = new short[mdats]; for (int i = 0; i < mdats; i++) MotiveData[i] = reader.ReadInt16(); HandObject = reader.ReadInt16(); RadianDirection = reader.ReadSingle(); if (Version > 1) KillTimeout = reader.ReadInt32(); DefaultSuits = new VMAvatarDefaultSuits(reader); var aprs = reader.ReadInt32(); BoundAppearances = new string[aprs]; for (int i = 0; i < aprs; i++) BoundAppearances[i] = reader.ReadString(); BodyOutfit = reader.ReadUInt64(); HeadOutfit = reader.ReadUInt64(); SkinTone = (AppearanceType)reader.ReadByte(); }
public VMAvatarMarshal Save() { var anims = new VMAnimationStateMarshal[Animations.Count]; int i = 0; foreach (var anim in Animations) anims[i++] = anim.Save(); var gameObj = new VMAvatarMarshal { Animations = anims, CarryAnimationState = (CarryAnimationState == null) ? null : CarryAnimationState.Save(), //NULLable Name = Name, Message = Message, MessageTimeout = MessageTimeout, MotiveChanges = MotiveChanges, PersonData = PersonData, MotiveData = MotiveData, HandObject = (HandObject == null) ? (short)0 : HandObject.ObjectID, RadianDirection = RadianDirection, DefaultSuits = DefaultSuits, BoundAppearances = BoundAppearances.ToArray(), BodyOutfit = BodyOutfit, HeadOutfit = HeadOutfit, SkinTone = SkinTone }; SaveEnt(gameObj); return gameObj; }
public override void Deserialize(BinaryReader reader) { base.Deserialize(reader); var anims = reader.ReadInt32(); Animations = new VMAnimationStateMarshal[anims]; for (int i = 0; i < anims; i++) { Animations[i] = new VMAnimationStateMarshal(reader); } var carry = reader.ReadBoolean(); if (carry) { CarryAnimationState = new VMAnimationStateMarshal(reader); } Message = reader.ReadString(); MessageTimeout = reader.ReadInt32(); var motCs = reader.ReadInt32(); MotiveChanges = new VMMotiveChange[motCs]; for (int i = 0; i < motCs; i++) { MotiveChanges[i] = new VMMotiveChange(); MotiveChanges[i].Deserialize(reader); } MotiveDecay = new VMAvatarMotiveDecay(); MotiveDecay.Deserialize(reader); var pdats = reader.ReadInt32(); PersonData = new short[Math.Max(101, pdats)]; for (int i = 0; i < pdats; i++) { PersonData[i] = reader.ReadInt16(); } var mdats = reader.ReadInt32(); MotiveData = new short[mdats]; for (int i = 0; i < mdats; i++) { MotiveData[i] = reader.ReadInt16(); } HandObject = reader.ReadInt16(); RadianDirection = reader.ReadSingle(); if (Version > 1) { KillTimeout = reader.ReadInt32(); } DefaultSuits = new VMAvatarDefaultSuits(reader); if (Version >= 15) { DynamicSuits = new VMAvatarDynamicSuits(reader); Decoration = new VMAvatarDecoration(reader); } else { DynamicSuits = new VMAvatarDynamicSuits(false); Decoration = new VMAvatarDecoration(); } var aprs = reader.ReadInt32(); BoundAppearances = new string[aprs]; for (int i = 0; i < aprs; i++) { BoundAppearances[i] = reader.ReadString(); } BodyOutfit = new VMOutfitReference(reader); HeadOutfit = new VMOutfitReference(reader); SkinTone = (AppearanceType)reader.ReadByte(); }
public override void Deserialize(BinaryReader reader) { base.Deserialize(reader); var anims = reader.ReadInt32(); Animations = new VMAnimationStateMarshal[anims]; for (int i = 0; i < anims; i++) { Animations[i] = new VMAnimationStateMarshal(reader); } var carry = reader.ReadBoolean(); if (carry) { CarryAnimationState = new VMAnimationStateMarshal(reader); } Name = reader.ReadString(); Message = reader.ReadString(); MessageTimeout = reader.ReadInt32(); var motCs = reader.ReadInt32(); MotiveChanges = new VMMotiveChange[motCs]; for (int i = 0; i < motCs; i++) { MotiveChanges[i] = new VMMotiveChange(); MotiveChanges[i].Deserialize(reader); } var pdats = reader.ReadInt32(); PersonData = new short[pdats]; for (int i = 0; i < pdats; i++) { PersonData[i] = reader.ReadInt16(); } var mdats = reader.ReadInt32(); MotiveData = new short[mdats]; for (int i = 0; i < mdats; i++) { MotiveData[i] = reader.ReadInt16(); } HandObject = reader.ReadInt16(); RadianDirection = reader.ReadSingle(); DefaultSuits = new VMAvatarDefaultSuits(reader); var aprs = reader.ReadInt32(); BoundAppearances = new string[aprs]; for (int i = 0; i < aprs; i++) { BoundAppearances[i] = reader.ReadString(); } BodyOutfit = reader.ReadUInt64(); HeadOutfit = reader.ReadUInt64(); SkinTone = (AppearanceType)reader.ReadByte(); }
public VMAnimationState(VMAnimationStateMarshal input) { Load(input); }