StateMachineAttribute
Attribute used to declare a state machine type by associating it with a file extension and optional configuration options.
Read time 4 minutesLast updated 6 days ago
Definition
- Type: Class
- Namespace: Unity.GraphToolkit.Editor
- Assembly: UnityEditor
- Inherits from: GraphAttribute
[AttributeUsage(AttributeTargets.Class)]public sealed class StateMachineAttribute : GraphAttribute
Remarks
Use this attribute to associate a custom StateMachine class with a unique file extension and StateMachineOptions. The parameter defines the file extension for the state machine assets. This extension must be unique across the project because Unity uses it to select the correct importer. You can also configure additional options using StateMachineOptions. This attribute is required for any class that inherits from StateMachine and serves as the entry point for enabling editor support for the state machine tool.
extensionThis is the StateMachine counterpart of GraphAttribute.
Examples
[StateMachine("mystatemachine", StateMachineOptions.DisableAutoInclusionOfStatesFromStateMachineAssembly)]public class MyStateMachine : StateMachine { }
Constructors
Constructor | Description |
|---|---|
| StateMachineAttribute(System.String,Unity.GraphToolkit.Editor.StateMachineOptions) | Initializes a new instance of the StateMachineAttribute class with a file extension and optional state machine options. |
Properties
Property | Description |
|---|---|
| Options | Gets the state machine configuration options. |