Ejemplo n.º 1
0
        public void CleanupAvatar()
        {
            StopLoadingCoroutines();

            eyebrowsController?.CleanUp();
            eyebrowsController = null;

            eyesController?.CleanUp();
            eyesController = null;

            bodyShapeController?.CleanUp();
            bodyShapeController = null;

            using (var iterator = wearableControllers.GetEnumerator())
            {
                while (iterator.MoveNext())
                {
                    iterator.Current.Value.CleanUp();
                }
            }

            wearableControllers.Clear();
            model          = null;
            isLoading      = false;
            OnFailEvent    = null;
            OnSuccessEvent = null;
        }
Ejemplo n.º 2
0
        public void CleanupAvatar()
        {
            StopLoadingCoroutines();

            eyebrowsController?.CleanUp();
            eyebrowsController = null;

            eyesController?.CleanUp();
            eyesController = null;

            mouthController?.CleanUp();
            mouthController = null;

            bodyShapeController?.CleanUp();
            bodyShapeController = null;

            using (var iterator = wearableControllers.GetEnumerator())
            {
                while (iterator.MoveNext())
                {
                    iterator.Current.Value.CleanUp();
                }
            }

            wearableControllers.Clear();
            model          = null;
            isLoading      = false;
            OnFailEvent    = null;
            OnSuccessEvent = null;

            if (lodController != null)
            {
                Environment.i.platform.avatarsLODController.RemoveAvatar(lodController);
            }

            if (bodySnapshotTexturePromise != null)
            {
                AssetPromiseKeeper_Texture.i.Forget(bodySnapshotTexturePromise);
            }

            CatalogController.RemoveWearablesInUse(wearablesInUse);
            wearablesInUse.Clear();
            OnVisualCue?.Invoke(VisualCue.CleanedUp);
        }
Ejemplo n.º 3
0
        void CleanUpUnusedItems()
        {
            if (model.wearables == null)
            {
                return;
            }

            var ids = wearableControllers.Keys.ToArray();

            for (var i = 0; i < ids.Length; i++)
            {
                var currentId = ids[i];
                var wearable  = wearableControllers[currentId];

                if (!model.wearables.Contains(wearable.id))
                {
                    wearable.CleanUp();
                    wearableControllers.Remove(currentId);
                }
            }

            if (!model.wearables.Contains(eyebrowsController.wearableId))
            {
                eyebrowsController.CleanUp();
            }

            if (!model.wearables.Contains(eyesController.wearableId))
            {
                eyesController.CleanUp();
            }

            if (!model.wearables.Contains(mouthController.wearableId))
            {
                mouthController.CleanUp();
            }
        }