Exemplo n.º 1
0
        protected override void OnEventFired(object source, CharacterButtonClickedEventArgs args)
        {
            CharacterAppearanceResponse data = CharacterAppearanceMappable.RetrieveEntity(args.CharacterGuid);

            CustomModelLoaderCancelable loader = AvatarLoaderFactory.Create(new CustomModelLoaderCreationContext(data.AvatarModelId, args.CharacterGuid));

            loader.StartLoading();
        }
Exemplo n.º 2
0
        public void Initialize()
        {
            int avatarModelId = this.Data.GetFieldValue <int>(GameObjectField.RESERVED_DATA_1);

            if (Logger.IsInfoEnabled)
            {
                Logger.Info($"Pedestal with ModelId: {avatarModelId} about to load model.");
            }

            //This just loads the avatar on top of the gameobject.
            CustomModelLoaderCancelable loaderCancelable = AvatarLoaderFactory.Create(new CustomModelLoaderCreationContext(avatarModelId, TargetEntity, UserContentType.Avatar));

            loaderCancelable.StartLoading();
        }
Exemplo n.º 3
0
        private void HandleModelChange([NotNull] NetworkEntityGuid entityGuid, EntityDataChangedArgs <int> changedModelId)
        {
            if (entityGuid == null)
            {
                throw new ArgumentNullException(nameof(entityGuid));
            }

            //The new id of the model is now known.
            CustomModelLoaderCancelable cancelable = AvatarLoaderFactory.Create(new CustomModelLoaderCreationContext(changedModelId.NewValue, entityGuid));

            if (AvatarLoaderMappable.ContainsKey(entityGuid))
            {
                AvatarLoaderMappable.RetrieveEntity(entityGuid).Cancel();
                AvatarLoaderMappable.ReplaceObject(entityGuid, cancelable);
            }
            else
            {
                AvatarLoaderMappable.AddObject(entityGuid, cancelable);
            }

            cancelable.StartLoading();
        }