You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can draw properties marked with the **[SerializeReference]** attribute with an additional type picker that allows you to manipulate what managed type will be serialized.
634
-
634
+
Depending on the picked type we have different object creation strategies:
635
+
-`Activator.CreateInstance(targetType)` (default constructor will be called and all readonly members will be initialized)
636
+
- Target type has default constructor
637
+
- Target type is a value type
638
+
-`FormatterServices.GetUninitializedObject(targetType)` (object will be uninitialized)
639
+
- Target type has one or more constructors with arguments
640
+
- `ForceUninitializedInstance` property is set to true
641
+
635
642
To prevent issues after renaming types use `UnityEngine.Scripting.APIUpdating.MovedFromAttribute`.
You can draw properties marked with the **[SerializeReference]** attribute with an additional type picker that allows you to manipulate what managed type will be serialized.
634
-
634
+
Depending on the picked type we have different object creation strategies:
635
+
-`Activator.CreateInstance(targetType)` (default constructor will be called and all readonly members will be initialized)
636
+
- Target type has default constructor
637
+
- Target type is a value type
638
+
-`FormatterServices.GetUninitializedObject(targetType)` (object will be uninitialized)
639
+
- Target type has one or more constructors with arguments
640
+
- `ForceUninitializedInstance` property is set to true
641
+
635
642
To prevent issues after renaming types use `UnityEngine.Scripting.APIUpdating.MovedFromAttribute`.
0 commit comments