Various other non-primitive types provided by Unity are serializable.
Common examples of these include: UnityEvent
, Bounds
,
Serializable Unity types should appear in debug mode; look for examples of them appearing in built-in components.
[System.Serializable]
attribute.Ensure that there are serializable types in that structure:
UnityEngine.Object
(a reference to a MonoBehaviour
for example) that isn't generic.int
, float
, double
, bool
, or string
)Vector2
, Vector3
, Vector4
, Rect
, Quaternion
, Matrix4x4
, Color
, Color32
, LayerMask
, AnimationCurve
, Gradient
, RectOffset
, GUIStyle
.[SerializeField]
attribute, or are public
.Empty structures or those without serializable fields are also not serializable.
abstract
, static
, const
, or readonly
.