File tree 1 file changed +7
-3
lines changed
1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 2
2
using System . Collections ;
3
3
using System . Collections . Generic ;
4
4
using Gilzoide . NamedEnum ;
5
- #if UNITY_5_3_OR_NEWER
5
+ #if UNITY_2020_1_OR_NEWER
6
6
using UnityEngine ;
7
7
#endif
8
8
@@ -11,7 +11,7 @@ namespace Gilzoide.EnumBitSet
11
11
[ Serializable ]
12
12
public class EnumBitSet < T , TData > : ISet < T >
13
13
, IReadOnlySet < T >
14
- #if UNITY_5_3_OR_NEWER
14
+ #if UNITY_2020_1_OR_NEWER
15
15
, ISerializationCallbackReceiver
16
16
#endif
17
17
where T : struct , Enum
@@ -172,14 +172,18 @@ IEnumerator IEnumerable.GetEnumerator()
172
172
173
173
#endregion
174
174
175
- #if UNITY_5_3_OR_NEWER
175
+ #if UNITY_2020_1_OR_NEWER
176
176
#region ISerializationCallbackReceiver
177
177
178
178
[ SerializeField ] private NamedEnum < T > [ ] _serializedEnums ;
179
179
180
180
public void OnAfterDeserialize ( )
181
181
{
182
182
Clear ( ) ;
183
+ if ( _serializedEnums == null )
184
+ {
185
+ return ;
186
+ }
183
187
foreach ( NamedEnum < T > serializedValue in _serializedEnums )
184
188
{
185
189
Add ( serializedValue ) ;
You can’t perform that action at this time.
0 commit comments