Skip to content

Changed light reset to preserve type #4624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions com.unity.render-pipelines.high-definition/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Removed redundant Show Inactive Objects and Isolate Selection checkboxes from the Emissive Materials tab of the Light Explorer (case 1331750).
- Renaming Decal Projector to HDRP Decal Projector.
- Display an info box and disable MSAA asset entry when ray tracing is enabled.
- Changed light reset to preserve type.

## [11.0.0] - 2020-10-21

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ static void ResetLight(MenuCommand menuCommand)

Light light = go.GetComponent<Light>();
HDAdditionalLightData lightAdditionalData = go.GetComponent<HDAdditionalLightData>();
HDLightType lightType = lightAdditionalData.type;

Assert.IsNotNull(light);
Assert.IsNotNull(lightAdditionalData);
Expand All @@ -36,6 +37,7 @@ static void ResetLight(MenuCommand menuCommand)
// To avoid duplicating init code we copy default settings to Reset additional data
// Note: we can't call this code inside the HDAdditionalLightData, thus why we don't wrap it in a Reset() function
HDUtils.s_DefaultHDAdditionalLightData.CopyTo(lightAdditionalData);
lightAdditionalData.type = lightType;

//reinit default intensity
HDAdditionalLightData.InitDefaultHDAdditionalLightData(lightAdditionalData);
Expand Down