Skip to content

Latest commit

 

History

History
36 lines (26 loc) · 1.02 KB

properties.md

File metadata and controls

36 lines (26 loc) · 1.02 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
public class MyScript : Script
{
	public float Field1 = 11;
	public Color Field2 = Color.Yellow;
	public DirectionalLight Field3 { get; set; }
}
  • Editor
    Script Properties

Attributes

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

[HideInEditor]
public float Field1 = 11;

If you want to don't serialize a public property or a field use NoSerialize attribute.

[NoSerialize]
public float Field1 = 11;

To learn more about using attributes see this page.

To learn more about scripts serialization see this page.