Integrating InControl with Rex Engine
It’s now fully integrated with Rex Engine, so users who have purchased both Rex Engine and InControl can use them together.
Here’s How To Integrate Them
- Import the InControl asset into your Rex Engine project.
- Under the RexEngine folder, open the “Integrations” folder, and unzip the “RexInControl” .zip file.
- Find the Singletons prefab, under RexEngine > Resources > System > Singletons. Drag the Singletons prefab onto the stage.
- Expand the Singletons prefab, and click on the InputManager GameObject in its children.
- In the Inspector, remove the UnityInputManager component.
- In RexEngine > Integrations > RexInControl, find InControlInputManager.cs. and drag this onto the InputManager GameObject.
- Under the InControl files in InControl > Source > Components, find the InControlManager.cs file, and drag this onto the InputManager GameObject.
- Hit “Apply” on the Singletons prefab, and delete it from the stage.
- Go to Edit > ProjectSettings > InControl > Setup InputManager Settings.
InControl should now be working with Rex Engine! You can test this by connecting an InControl-compatible input device and testing your Rex Engine game.
You can change InControl’s inputs via the RexPlayerActionSet.cs class. If you open this script, you’ll see a list of actions and their corresponding buttons starting on line 41. For example, on lines 41, 42, and 43, you’ll see the following code:
playerActions.Jump.AddDefaultBinding( Key.Space );
playerActions.Jump.AddDefaultBinding( Key.H );
playerActions.Jump.AddDefaultBinding( InputControlType.Action1 );
This code binds the Jump action to the Space key, the H key, and InControl’s Action1 button, respectively. These can be edited to any buttons of your choosing. For more documentation on InControl’s button mappings, check out the InControl: Standardized Controls documentation.