public bool IsSerializable(Type type)
        {
            if (IsSimpleType(type) ||
                type.IsA <UnityObject>() ||
                UnityStructs.ContainsValue(type))
            {
                return(true);
            }

            if (type.IsArray)
            {
                return(type.GetArrayRank() == 1 && IsSerializable(type.GetElementType()));
            }

            if (type.IsInterface)
            {
                return(true);
            }

            if (NotSupportedTypes.Any(type.IsA))
            {
                return(false);
            }

            if (SupportedTypes.Any(type.IsA))
            {
                return(true);
            }

            if (type.IsGenericType)
            {
                return(type.GetGenericArguments().All(IsSerializable));
            }

            return(attributes.SerializableType.IsNullOrEmpty() || attributes.SerializableType.Any(type.IsDefined));
        }
        /// <summary>
        /// Types don't need to be annotated with any special attributes for them to be serialized
        /// A type is serialized if:
        /// - it's a primitive, enum or string
        /// - or a UnityEngine.Object
        /// - or a Unity struct
        /// - or a single-dimensional array and the element type is serializable
        /// - or an interface
        /// - or included in the 'SupportedTypes' array
        /// - it's not included in the 'NotSupportedTypes' array
        /// - it's generic and all its generic type arguments are serializable as well
        /// </summary>
        public override bool IsSerializableType(Type type)
        {
            if (type.IsPrimitive || type.IsEnum || type == typeof(string) ||
                type.IsA <UnityObject>() ||
                UnityStructs.ContainsValue(type))
            {
                return(true);
            }

            if (type.IsArray)
            {
                return(type.GetArrayRank() == 1 && IsSerializableType(type.GetElementType()));
            }

            if (type.IsInterface)
            {
                return(true);
            }

            if (NotSupportedTypes.Any(type.IsA))
            {
                return(false);
            }

            if (SupportedTypes.Any(type.IsA))
            {
                return(true);
            }

            if (type.IsGenericType)
            {
                return(type.GetGenericArguments().All(IsSerializableType));
            }

            return(true);
        }
        public static bool IsSerializableType(Type type)
        {
            if (type.IsPrimitive || type.IsEnum || type == typeof(string) ||
                typeof(UnityObject).IsAssignableFrom(type) ||
                IsUnityType(type))
            {
                return(true);
            }

            if (type.IsArray)
            {
                return(type.GetArrayRank() == 1 && IsSerializableType(type.GetElementType()));
            }

            if (type.IsInterface)
            {
                return(true);
            }

            if (NotSupportedTypes.Any(type.IsA))
            {
                return(false);
            }

            if (SupportedTypes.Any(type.IsA))
            {
                return(true);
            }

            if (type.IsGenericType)
            {
                return(type.GetGenericArguments().All(IsSerializableType));
            }

            return(true);
        }