AddRule
Creates a new empty transition rule and appends it to this transition.
Read time 1 minuteLast updated 13 days ago
Definition
- Type: Method
- Namespace: Unity.GraphToolkit.Editor
- Assembly: UnityEditor
AddRule()
Creates a new empty transition rule and appends it to this transition.
ITransitionRule AddRule()
Returns
Type | Description |
|---|---|
| ITransitionRule | The newly created ITransitionRule. |
Remarks
The new rule is added at the end of the transition rule set.
AddRule(ITransitionRule)
Adds an existing rule to this transition.
void AddRule(ITransitionRule rule)
Parameters
The rule to add.
Remarks
If the already belongs to another transition of the same state machine, it is first removed from that transition: the rule is moved, not copied. A rule cannot be moved between state machines. Because a transition always keeps at least one rule, a rule cannot be moved out of a transition that holds it as its only rule; use StateMachine.Disconnect to remove that transition instead. The rule is added at the end of the transition rule set. Throws ArgumentNullException when is . Throws ArgumentException when is not a valid rule, already belongs to a transition in another state machine, or is not accepted by this transition. Throws InvalidOperationException when is the last rule of the transition it belongs to.
rulerulenullrulerule