Skip to content

Commit

Permalink
Fixed an issue where the objects displayed by Camera Plus were not li…
Browse files Browse the repository at this point in the history
…nked to the HMD.
  • Loading branch information
Snow1226 committed Mar 29, 2020
1 parent a5f6a7a commit c310d30
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CameraPlus/CameraPlusBehaviour.cs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ protected IEnumerator DelayedInit()
AddMovementScript();

SetCullingMask();
_cam.cullingMask |= (1 << ParticleLayer);
CameraMovement.CreateExampleScript();

Plugin.Instance.ActiveSceneChanged += SceneManager_activeSceneChanged;
Expand Down Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions CameraPlus/CameraUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions CameraPlus/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
4 changes: 2 additions & 2 deletions CameraPlus/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
2 changes: 1 addition & 1 deletion CameraPlus/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"gameVersion": "1.8.0",
"id": "CameraPlus",
"name": "CameraPlus",
"version": "4.0.1",
"version": "4.0.2",
"features": [],
"dependsOn": {
}
Expand Down

0 comments on commit c310d30

Please sign in to comment.