File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Change Log
22
3+ ## [ 0.7.2-beta] - Aug 24, 2024
4+ - Exposed the JumpTo method on the StateMachineController
5+ - This allows users to manually trigger a JumpIn node externally broadening the use-cases for the VSM
6+ - Exposed the State member of the StateMachine through a public State member of the StateMachineController
7+ - This allows users to determine the current state and to directly call methods upon externally.
8+ - I experimented with implementing a StatePattern with all States implementing a common interface.
9+
310## [ 0.7.1-beta] - Aug 21, 2024
411- Amended the exception forwarding of StateMachine to throw the original exception rather than wrapping it. This improves debugging errors in states.
512
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.
Original file line number Diff line number Diff line change 11{
22 "name" : " com.nonatomic.visualstatemachinev2" ,
3- "version" : " 0.7.1 -beta" ,
3+ "version" : " 0.7.2 -beta" ,
44 "displayName" : " Visual State Machine V2" ,
55 "description" : " Visual State Machine V2" ,
66 "unity" : " 2022.3" ,
You can’t perform that action at this time.
0 commit comments