@@ -28,8 +28,6 @@ pattern or be used to address specific tasks.
2828
2929##Table of Contents
3030
31- ##Table of Contents
32-
3331<!-- TOC start (generated with https://github.com/derlin/bitdowntoc)-->
3432
3533- [ Getting Started] ( #getting-started )
@@ -80,6 +78,10 @@ pattern or be used to address specific tasks.
8078+ [ Zenject Preparation] ( #zenject-preparation )
8179+ [ Zenject Usage] ( #zenject-usage )
8280+ [ Zenject Registering] ( #zenject-registering )
81+ * [ Reflex] ( #reflex )
82+ + [ Reflex Preparation] ( #reflex-preparation )
83+ + [ Reflex Usage] ( #reflex-usage )
84+ + [ Reflex Registering] ( #reflex-registering )
8385- [ License] ( #license )
8486
8587<!-- TOC end-->
@@ -1131,6 +1133,78 @@ private void BindStates(DiContainer container)
11311133}
11321134```
11331135
1136+ ###Reflex
1137+
1138+ > ** Note:** The Reflex integration is experimental, not fully tested, and subject to change.
1139+
1140+ GitHub:[ Reflex] ( https://github.com/gustavopsantos/Reflex )
1141+
1142+ ####Reflex Preparation
1143+
1144+ If Reflex is installed via UPM, you can skip this step and proceed directly to the[ Reflex Usage] ( #reflex-usage )
1145+ section.
1146+
1147+ If Reflex is not installed via UPM, manually add the` UNISTATE_REFLEX_SUPPORT ` define symbol to your Scripting Define
1148+ Symbols (Player Settings -> Player -> Scripting Define Symbols).
1149+
1150+ ####Reflex Usage
1151+
1152+ No additional setup is required after registering. Simply resolve the state machine from the Reflex DI container and
1153+ invoke its` Execute ` method.
1154+
1155+ Here's an example:
1156+
1157+ ``` csharp
1158+ using System .Threading ;
1159+ using Cysharp .Threading .Tasks ;
1160+ using Examples .States ;
1161+ using UniState ;
1162+
1163+ namespace Examples .Infrastructure .Reflex
1164+ {
1165+ public class DiceEntryPoint
1166+ {
1167+ private readonly IStateMachine _stateMachine ;
1168+
1169+ public DiceEntryPoint (IStateMachine stateMachine )=> _stateMachine = stateMachine ;
1170+
1171+ public void Start ()
1172+ {
1173+ _stateMachine .Execute <StartGameState >(CancellationToken .None ).Forget ();
1174+ }
1175+ }
1176+ }
1177+ ```
1178+
1179+ ####Reflex Registering
1180+
1181+ All state machines, states, and their dependencies should be registered in the DI container using Reflex's
1182+ ` ContainerBuilder ` . Special extension methods have been provided for convenient registration.
1183+
1184+ Here's example code demonstrating the available extension methods:
1185+
1186+ ``` csharp
1187+ using Reflex .Core ;
1188+ using UniState ;
1189+
1190+ private void RegisterStates (ContainerBuilder builder )
1191+ {
1192+ // Recommended usage for general cases
1193+
1194+ builder .AddStateMachine <IStateMachine ,BarStateMachine >();
1195+ builder .AddState <BarState >();
1196+ builder .AddState <IBarState ,BarState >();
1197+ builder .AddState (typeof (BarState ));
1198+
1199+ // Singleton version (use cautiously, not recommended in most cases)
1200+
1201+ builder .AddSingletonStateMachine <IStateMachine ,BarStateMachine >();
1202+ builder .AddSingletonState <BarState >();
1203+ builder .AddSingletonState <IBarState ,BarState >();
1204+ builder .AddSingletonState (typeof (BarState ));
1205+ }
1206+ ```
1207+
11341208##License
11351209
11361210This library is under the MIT License. Full text is[ here] ( LICENSE ) .