Fix Any state transitions will be created from SSMs:

- Due to an implementation error, creating Any state transitions previously did not have any effect in the graph.
- This now creates Any state from the root machine.
- Sub-state machines "cannot" have Any state transitions created directly from them.
- Internally, Any always comes from the root state machine, but visually in the graph, it will come from the sub-state machine.
This commit is contained in:
Haï~
2024-08-19 01:40:08 +02:00
parent 4c50d8876e
commit 01724155b0
2 changed files with 15 additions and 2 deletions
@@ -23,6 +23,14 @@ namespace AnimatorAsCode.V1
AnimatorRoot = animatorRoot;
}
internal AacFlStateMachine RootMachine()
{
if (ParentMachine != null) return ParentMachine.RootMachine();
if (this is AacFlStateMachine root)
return root;
return null;
}
/// Move the node the left of the other node in the graph.
public TNode LeftOf(AacAnimatorNode otherNode) => MoveNextTo(otherNode, -1, 0);