Skip to content
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
6 changes: 6 additions & 0 deletions com.unity.render-pipelines.universal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this package will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Fixed
- Fixed an issue where ShadowCaster2Ds were sometimes being rendered twice in the editor while in playmode.


## [10.9.0] - 2021-12-06

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,36 @@
using System.Collections.Generic;
using UnityEngine;

#if UNITY_EDITOR
using UnityEditor;
#endif

namespace UnityEngine.Experimental.Rendering.Universal
{
#if UNITY_EDITOR
[InitializeOnLoadAttribute]
#endif
internal class ShadowCasterGroup2DManager
{
static List<ShadowCasterGroup2D> s_ShadowCasterGroups = null;

public static List<ShadowCasterGroup2D> shadowCasterGroups { get { return s_ShadowCasterGroups; } }


#if UNITY_EDITOR
static ShadowCasterGroup2DManager()
{
EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
}

private static void OnPlayModeStateChanged(PlayModeStateChange state)
{
if (s_ShadowCasterGroups != null && (state == PlayModeStateChange.ExitingEditMode || state == PlayModeStateChange.ExitingPlayMode))
s_ShadowCasterGroups.Clear();
}

#endif

public static void AddShadowCasterGroupToList(ShadowCasterGroup2D shadowCaster, List<ShadowCasterGroup2D> list)
{
int positionToInsert = 0;
Expand Down