-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Repro states
public class State1 : StateBase
{
public override async UniTask<StateTransitionInfo> Execute(CancellationToken token)
{
Debug.Log("State1");
await UniTask.Yield();
return Transition.GoTo<State2>();
}
}
public class State2 : StateBase
{
private static bool wasPerformed = false;
public override async UniTask<StateTransitionInfo> Execute(CancellationToken token)
{
Debug.Log("State2");
await UniTask.Yield();
var state = wasPerformed ? Transition.GoBack() : Transition.GoTo<State3>();
wasPerformed = true;
return state;
}
}
public class State3 : StateBase
{
public override async UniTask<StateTransitionInfo> Execute(CancellationToken token)
{
Debug.Log("State3");
await UniTask.Yield();
return Transition.GoBack();
}
}
State machine execution
Debug.Log("State machine initialized");
await _stateMachine.Execute<State1>(cts.GetRenewedToken());
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex, LoadSceneMode.Single);
Expected behaviour:
- GoBack doesn't result in the same state being executed
- GoBack to first state of the state machine doesn't result in state machine being closed
bazyleu
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working