Available Attributes¶
This page lists some attributes available for scripting.
Wasm Scripting Attributes¶
WasmScripting
| Attribute | Description |
|---|---|
| [WasmSerialized] | Marks a field to be included by the WASM serializer. |
| [NonWasmSerialized] | Marks a field to be ignored by the WASM serializer. |
| [ExternallyVisible] | Marks a method as being callable from outside the WASM module. See UnityEvent Rewiring for usage. |
Unity Attributes¶
UnityEngine
| Attribute | Description |
|---|---|
| [SerializeField] | Marks a private field to be serialized. |
| [DefaultExecutionOrder(int)] | Sets the execution order of a WasmBehaviour relative to other WasmBehaviours. Lower values run earlier. See Available Events for usage. |
C# Standard Attributes¶
System
| Attribute | Description |
|---|---|
| [Serializable] | Marks a class or struct as serializable. |
Tip
The CCK's WASM serializer will serialize anything Unity's built-in serializer can serialize. You can mix and match the above attributes to achieve the desired serialization behavior, for example, serializing something in Unity but not in WASM.
Unity Editor Attributes¶
UnityEngine
The following attributes are not included in your built WASM module by default.
They can be included in your WASM module by adding UNITY_EDITOR_ATTRIBUTES to the Scripting Define Symbols in the CCK Wasm Project Descriptor if you ever need to use them at runtime (not recommended).
| Attribute | Description |
|---|---|
| [HideInInspector] | Hides a public field from the Unity Inspector. |
| [Header(string)] | Adds a header above a field in the Unity Inspector. |
| [PropertyRange(float min, float max)] | Constrains a numeric field to a range in the Unity Inspector. |
| [Space(float height)] | Adds vertical space above a field in the Unity Inspector. |
| [Tooltip(string)] | Adds a tooltip to a field in the Unity Inspector. |
| [ColorUsage(bool showAlpha, bool hdr)] | Configures color field options in the Unity Inspector. |