Skip to content

Commit 761909b

Browse files
Hdrp/fix camera switcher (#591)
* Fixed a wrong condition in camera switcher, potentially causing out of bound exceptions. * update changelog.
1 parent 66b5a7e commit 761909b

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

com.unity.render-pipelines.core/Runtime/Camera/CameraSwitcher.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Camera GetNextCamera()
8989

9090
void SetCameraIndex(int index)
9191
{
92-
if (index > 0 || index < GetCameraCount())
92+
if (index > 0 && index < GetCameraCount())
9393
{
9494
m_CurrentCameraIndex = index;
9595

com.unity.render-pipelines.high-definition/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
622622
- Fixed Wizard check on default volume profile to also check it is not the default one in package.
623623
- Fix erroneous central depth sampling in TAA.
624624
- Fixed light layers not correctly disabled when the lightlayers is set to Nothing and Lightlayers isn't enabled in HDRP Asset
625+
- Fixed a wrong condition in CameraSwitcher, potentially causing out of bound exceptions.
625626

626627
### Changed
627628
- Improve MIP selection for decals on Transparents

0 commit comments

Comments
 (0)