Serializable with scriptwizard input filed
The ScriptableWizard class autogenerates input fields for only serializable public properties, and not
simply any public properties. Why not? Have you ever created your own custom class and found you cannot
view its members in the Object Inspector as you can with some other Unity-based classes, such as Vector2
and Vector3? That’s because your class is probably not marked as serializable.
Both the Object Inspector and ScriptableWizard can only show GUI inputs for serializable classes.
This typically includes many standard data types, including: string, int, float, color, vector3, rect,
texture2d, material, mesh, and more. In short, if a class or object shows in the Object Inspector,
then it’ll show in the ScriptableWizard window when added as a public property of the class.
We’ll return to the issue of Serializable later when creating our own custom object that’ll show in
the Objet Inspector
Some examples of non-serialized classes include: Dictionary and Queue. These will not display
in the Object Inspector, even when declared as public members of your class. Of course, that doesn’t
mean those members aren’t genuine members or won’t work properly at runtime. It means only that their
values won’t show in the Object Inspector. For more information visit:
http://docs.unity3d.com/Documentation/ScriptReference/Serializable.html

浙公网安备 33010602011771号