private void UpdateSmoothCamera(DiContainer container) { if (!_mainSettingsModel.smoothCameraEnabled) { return; } SmoothCamera smoothCamera = container.TryResolve <SmoothCamera>(); if (!smoothCamera) { _logger.Warning("Smooth camera not found!"); return; } Camera camera = smoothCamera.GetPrivateField <Camera>("_camera"); bool thirdPersonEnabled = smoothCamera.GetPrivateField <bool>("_thirdPersonEnabled"); _logger.Info($"Setting avatar culling mask and near clip plane on '{camera.name}'"); if (!_settings.showAvatarInSmoothCamera) { camera.cullingMask = camera.cullingMask & ~AvatarLayers.kAllLayersMask; camera.nearClipPlane = kCameraDefaultNearClipMask; } else if (thirdPersonEnabled) { camera.cullingMask = camera.cullingMask | AvatarLayers.kOnlyInThirdPersonMask | AvatarLayers.kAlwaysVisibleMask; camera.nearClipPlane = kCameraDefaultNearClipMask; } else { camera.cullingMask = (camera.cullingMask & ~AvatarLayers.kOnlyInThirdPersonMask) | AvatarLayers.kAlwaysVisibleMask; camera.nearClipPlane = _settings.cameraNearClipPlane; } }