Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


StateMachineAttribute(string, StateMachineOptions)

Initializes a new instance of the StateMachineAttribute class with a file extension and optional state machine options.
Read time 1 minuteLast updated 6 days ago

Definition

public StateMachineAttribute(string extension, StateMachineOptions options = StateMachineOptions.Default)

Parameters

extension

The file extension to associate with assets of the state machine type. This value must be unique because Unity uses it to select the correct importer.

The configuration options for the state machine. Defaults to StateMachineOptions.Default if not specified.

Remarks

Use this constructor to define the asset extension and configure the state machine. This allows for proper asset recognition and import handling by Unity. The values in StateMachineOptions support bitwise combination. Combine multiple flags to configure the state machine with custom behavior.

Examples

[StateMachine("mystatemachine", StateMachineOptions.DisableAutoInclusionOfStatesFromStateMachineAssembly)]public class MyStateMachine : StateMachine { }