public void RegisterAvatar(AvatarLODController newAvatar) { if (!DataStore.i.avatarsLOD.LODEnabled.Get() || avatarsList.Contains(newAvatar) || newAvatar == null) { return; } avatarsList.Add(newAvatar); }
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) } }
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; } } }