Skip to content

Commit 578cdfe

Browse files
committed
Exclude primitive and enum types from intrinsic policy
Added checks to filter out primitive and enum types in the intrinsic type policy, ensuring only appropriate types are considered for serialization.
1 parent a89a0ba commit 578cdfe

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Assets/MackySoft/MackySoft.SerializeReferenceExtensions/Editor/IIntrinsicTypePolicy.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public bool IsAllowed (Type candiateType)
1818
(candiateType.IsPublic || candiateType.IsNestedPublic || candiateType.IsNestedPrivate) &&
1919
!candiateType.IsAbstract &&
2020
!candiateType.IsGenericType &&
21+
!candiateType.IsPrimitive &&
22+
!candiateType.IsEnum &&
2123
!typeof(UnityEngine.Object).IsAssignableFrom(candiateType) &&
2224
Attribute.IsDefined(candiateType, typeof(SerializableAttribute)) &&
2325
!Attribute.IsDefined(candiateType, typeof(HideInTypeMenuAttribute));

0 commit comments

Comments
 (0)