File tree Expand file tree Collapse file tree
Assets/LDtkUnity/Editor/Builders Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,24 +10,19 @@ internal sealed class LDtkSortingOrder
1010 {
1111 public int SortingOrderValue { get ; private set ; } = 0 ;
1212 private readonly Dictionary < string , int > _layerNameOverrides ;
13- private readonly HashSet < string > _layerNameOccurrences ;
13+ private readonly HashSet < string > _layerNameOccurrences = new HashSet < string > ( ) ;
1414
1515 public LDtkSortingOrder ( Dictionary < string , int > layerNameOverrides = null )
1616 {
1717 _layerNameOverrides = layerNameOverrides ;
18-
19- if ( layerNameOverrides != null )
20- {
21- _layerNameOccurrences = new HashSet < string > ( layerNameOverrides . Count ) ;
22- }
2318 }
2419
2520 public void Next ( string layerIdentifier = null )
2621 {
2722 //note: this supports repeated layer occurrences, even if that never happens.
2823
2924 //Jump to the custom order if we get the first occurrence of a layer
30- if ( layerIdentifier != null && _layerNameOccurrences != null && _layerNameOccurrences . Add ( layerIdentifier ) )
25+ if ( layerIdentifier != null && _layerNameOccurrences . Add ( layerIdentifier ) )
3126 {
3227 if ( _layerNameOverrides != null && _layerNameOverrides . TryGetValue ( layerIdentifier , out int order ) )
3328 {
You can’t perform that action at this time.
0 commit comments