Skip to content

Commit

Permalink
Fix Getting Started examples in documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
bazyleu committed Dec 12, 2024
1 parent 195659e commit cadbc45
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ public class MainMenuState : StateBase
return Transition.GoTo<GameplayState>();
}
}

public class GameplayState : StateBase
{
public override async UniTask<StateTransitionInfo> Execute(CancellationToken token)
{
// Add your state logic here
return Transition.GoBack();
}
}
```
Detailed information about creating states is
available [here](#state-creating).
Expand All @@ -80,6 +89,7 @@ available [here](#state-creating).
```csharp
builder.RegisterStateMachine<StateMachine>();
builder.RegisterState<MainMenuState>();
builder.RegisterState<GameplayState>();
```
Additional information on DI configuration is available [here](#integrations).

Expand All @@ -93,7 +103,7 @@ Additional information on DI configuration is available [here](#integrations).
public async void Run()
{
var stateMachine = StateMachineHelper.CreateStateMachine<StateMachine>(_objectResolver.ToTypeResolver());
await stateMachine.Execute<GameLoadingState>(_ctx.Token);
await stateMachine.Execute<MainMenuState>(_ctx.Token);
}
}
```
Expand Down

0 comments on commit cadbc45

Please sign in to comment.