From c310d308f840cc3427ba02706755d3ec0aab310d Mon Sep 17 00:00:00 2001 From: Snow1226 Date: Mon, 30 Mar 2020 00:12:56 +0900 Subject: [PATCH] Fixed an issue where the objects displayed by Camera Plus were not linked to the HMD. --- CameraPlus/CameraPlusBehaviour.cs | 2 +- CameraPlus/CameraUtilities.cs | 8 ++++++++ CameraPlus/Plugin.cs | 1 + CameraPlus/Properties/AssemblyInfo.cs | 4 ++-- CameraPlus/manifest.json | 2 +- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/CameraPlus/CameraPlusBehaviour.cs b/CameraPlus/CameraPlusBehaviour.cs index edad817..a2a67e7 100644 --- a/CameraPlus/CameraPlusBehaviour.cs +++ b/CameraPlus/CameraPlusBehaviour.cs @@ -201,7 +201,6 @@ protected IEnumerator DelayedInit() AddMovementScript(); SetCullingMask(); - _cam.cullingMask |= (1 << ParticleLayer); CameraMovement.CreateExampleScript(); Plugin.Instance.ActiveSceneChanged += SceneManager_activeSceneChanged; @@ -503,6 +502,7 @@ internal virtual void SetFOV() internal virtual void SetCullingMask() { + _cam.cullingMask = Camera.main.cullingMask; if (Config.transparentWalls) _cam.cullingMask &= ~(1 << TransparentWallsPatch.WallLayerMask); else diff --git a/CameraPlus/CameraUtilities.cs b/CameraPlus/CameraUtilities.cs index ad4eb4e..a233246 100644 --- a/CameraPlus/CameraUtilities.cs +++ b/CameraPlus/CameraUtilities.cs @@ -137,6 +137,14 @@ string msg return false; } + public static void SetAllCamerCulling() + { + foreach (CameraPlusInstance c in Plugin.Instance.Cameras.Values.ToArray()) + { + c.Instance.SetCullingMask(); + } + } + public static void ReloadCameras() { try diff --git a/CameraPlus/Plugin.cs b/CameraPlus/Plugin.cs index 4d12178..dcb622d 100644 --- a/CameraPlus/Plugin.cs +++ b/CameraPlus/Plugin.cs @@ -68,6 +68,7 @@ private IEnumerator DelayedActiveSceneChanged(Scene from, Scene to) // If any new cameras have been added to the config folder, render them // if(to.name == ) CameraUtilities.ReloadCameras(); + CameraUtilities.SetAllCamerCulling(); if (ActiveSceneChanged != null) { diff --git a/CameraPlus/Properties/AssemblyInfo.cs b/CameraPlus/Properties/AssemblyInfo.cs index 4577a0d..145790e 100644 --- a/CameraPlus/Properties/AssemblyInfo.cs +++ b/CameraPlus/Properties/AssemblyInfo.cs @@ -31,5 +31,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("4.0.1")] -[assembly: AssemblyFileVersion("4.0.1")] +[assembly: AssemblyVersion("4.0.2")] +[assembly: AssemblyFileVersion("4.0.2")] diff --git a/CameraPlus/manifest.json b/CameraPlus/manifest.json index 32421c9..a33c5dd 100644 --- a/CameraPlus/manifest.json +++ b/CameraPlus/manifest.json @@ -5,7 +5,7 @@ "gameVersion": "1.8.0", "id": "CameraPlus", "name": "CameraPlus", - "version": "4.0.1", + "version": "4.0.2", "features": [], "dependsOn": { }