Get the index of the current layer the object is assigned to.
Will always be `null` if the game doesn't use layers.
layer(): string | null
Get the name of the current layer the object is assigned to.
Will always be `null` if the game doesn't use layers.
layer(name: string ):
Set the name of the layer the object should be assigned to.
Throws an error if the game uses layers and the requested layer
wasn't defined.