Skip to content

Latest commit

 

History

History
47 lines (36 loc) · 1.24 KB

properties.md

File metadata and controls

47 lines (36 loc) · 1.24 KB

Script properties and fields

Every script can contain various fields and properties. By default Flax shows all public fields and properties in the Properties window so user may edit them (undo/redo is supported).

Script

[!code-csharpExample1]

[!code-cppExample2]


Script Properties

Attributes

If you want to hide a public property or a field simply use HideInEditor attribute.

[HideInEditor]
public float Field1 = 11;
API_FIELD(Attributes="HideInEditor")
float Field1 = 11;

If you do not want to serialize a public property or a field, use the NoSerialize attribute.

[NoSerialize]
public float Field1 = 11;
API_FIELD(Attributes="NoSerialize")
float Field1 = 11;

To learn more about using attributes see this page.

To learn more about scripts serialization see this page.