Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

UseWithStateMachineAttribute

class in Unity.GraphToolkit.Editor

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

Attribute used to specify which StateMachine types are compatible with the decorated state machine element, such as a State, SelfTransition, or Condition class.

This attribute links a specific state machine element to one or more StateMachine types, enabling fine-grained control over which state machine types support the element. This allows framework authors to explicitly declare element compatibility across different kinds of state machines and ensures that only valid elements are available for use in each state machine context. By default, elements defined in the same assembly as the state machine are considered compatible and available. In this default setup, the UseWithStateMachineAttribute is not required. However, when a state machine uses StateMachineOptions.DisableAutoInclusionOfStatesFromStateMachineAssembly, this attribute must be used to declare which StateMachine types support the element. This attribute affects editor behaviors such as graph item library population and helps prevent the accidental use of unsupported elements. This is the StateMachine counterpart of UseWithGraphAttribute.

Constructors

Constructor Description
UseWithStateMachineAttribute Initializes a new instance of the UseWithStateMachineAttribute class with the specified supported state machine types.

Public Methods

Method Description
IsStateMachineTypeSupported Determines whether the specified state machine type supports the element decorated with this attribute.