Inheritance: VMEntityMarshal
Beispiel #1
0
 public virtual void LoadCrossRef(VMAvatarMarshal input, VMContext context)
 {
     base.LoadCrossRef(input, context);
     HandObject = context.VM.GetObjectById(input.HandObject);
     if (HandObject != null && HandObject is VMGameObject) ((ObjectComponent)HandObject.WorldUI).ForceDynamic = true;
     //we need to fix the gender, since InitBodyData resets it.
     var gender = GetPersonData(VMPersonDataVariable.Gender);
     InitBodyData(context);
     SetPersonData(VMPersonDataVariable.Gender, gender);
     BodyOutfit = input.BodyOutfit;
     HeadOutfit = input.HeadOutfit;
 }
Beispiel #2
0
        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;
        }
Beispiel #3
0
        public virtual void Load(VMAvatarMarshal input)
        {
            base.Load(input);

            Animations = new List<VMAnimationState>();
            foreach (var anim in input.Animations) Animations.Add(new VMAnimationState(anim));
            CarryAnimationState = (input.CarryAnimationState == null) ? null : new VMAnimationState(input.CarryAnimationState);

            Name = input.Name;
            Message = input.Message;

            MessageTimeout = input.MessageTimeout;

            MotiveChanges = input.MotiveChanges;
            PersonData = input.PersonData;
            MotiveData = input.MotiveData;
            RadianDirection = input.RadianDirection;
            DefaultSuits = input.DefaultSuits;

            BoundAppearances = new HashSet<string>(input.BoundAppearances);

            foreach (var aprN in BoundAppearances)
            {
                var apr = FSO.Content.Content.Get().AvatarAppearances.Get(aprN);
                Avatar.AddAccessory(apr);
            }

            SkinTone = input.SkinTone;

            if (UseWorld) ((AvatarComponent)WorldUI).ObjectID = (ushort)ObjectID;
        }