File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ public class StateMachine
1515 {
1616 public event Action < State , StateMachineModel > OnComplete ;
1717
18+ public State State => _currentNode ? . State ;
1819 public StateMachineModel Model { get ; private set ; }
1920 public bool IsComplete { get ; private set ; }
2021
Original file line number Diff line number Diff line change 11using System ;
2+ using Nonatomic . VSM2 . StateGraph . States ;
23using UnityEngine ;
34
45namespace Nonatomic . VSM2 . StateGraph
@@ -12,6 +13,8 @@ public class StateMachineController : MonoBehaviour
1213 /// Gets the unique identifier for this controller.
1314 /// </summary>
1415 public string Id => _id ;
16+
17+ public State State => _stateMachine ? . State ;
1518
1619 /// <summary>
1720 /// Gets the current StateMachineModel, either from the active state machine or the serialized field.
@@ -27,6 +30,15 @@ public class StateMachineController : MonoBehaviour
2730 private bool _activated ;
2831 private bool _started ;
2932
33+ /// <summary>
34+ /// Jumps to a state via a JumpIn state using the JumpId to identify the JumpIn node.
35+ /// </summary>
36+ /// <param name="id">The JumpIn id of the destination JumpIn node</param>
37+ public void JumpTo ( JumpId id )
38+ {
39+ _stateMachine ? . JumpTo ( id ) ;
40+ }
41+
3042 /// <summary>
3143 /// Changes the StateMachineModel and reinitializes the state machine.
3244 /// If the GameObject is active and has already started, it will also call Start and Enter on the new state machine.
You can’t perform that action at this time.
0 commit comments