コード例 #1
0
        public void RegisterAvatar(AvatarLODController newAvatar)
        {
            if (!DataStore.i.avatarsLOD.LODEnabled.Get() || avatarsList.Contains(newAvatar) || newAvatar == null)
            {
                return;
            }

            avatarsList.Add(newAvatar);
        }
コード例 #2
0
        private void Awake()
        {
            animator           = GetComponent <AvatarAnimatorLegacy>();
            stickersController = GetComponent <StickersController>();

            if (lodRenderer != null)
            {
                lodController = new AvatarLODController()
                {
                    transform    = this.transform,
                    meshRenderer = lodRenderer,
                    mesh         = lodMeshFilter.mesh
                };
                lodController.OnLODToggle += (newValue) => SetVisibility(!newValue); // TODO: Resolve coping with AvatarModifierArea regarding this toggling (issue #718)
            }
        }
コード例 #3
0
        public void RemoveAvatar(AvatarLODController targetAvatar)
        {
            if (!DataStore.i.avatarsLOD.LODEnabled.Get() || !avatarsList.Contains(targetAvatar) || targetAvatar == null)
            {
                return;
            }

            int listCount = avatarsList.Count;

            for (int i = 0; i < listCount; i++)
            {
                if (avatarsList[i] == targetAvatar)
                {
                    avatarsList.RemoveAt(i);

                    targetAvatar.ToggleLOD(false);

                    return;
                }
            }
        }