SplitScript reference / Language / static

static

syntax

static Type field;

Declares a managed field read through its class rather than an instance.

Access the field as Class.field. Resolving the field offset and reading its live value are fallible, just like an instance-field hop. A static field may reference its own class, which is useful for singleton instances such as GameManager.instance. Metadata offsets and static storage are bound once per attachment, but the field value itself is read live so a replaced singleton is observed on the next state poll.

Examples

Read a managed singleton

let manager = GameManager.instance else return