skip to Main Content

Changing default Input system

Terrain Grid System was designed to use the classic Unity input system (like Input.GetMouseButton methods, etc.). To support future and new input systems, the asset has decoupled the input calls and centralized them into a different class, called DefaultInputSystem.cs located in TerrainGridSystem/Scripts/Core/Input folder. This class implements the interface IInputProxy.

There’s another class called NewInputSystem.cs which adds support for the New Input System. Terrain Grid System will automatically use one or the other input proxy class depending on the current input system active in Player Settings.

You can also modify these classes or create a new class that derive and implements the IInputProxy, so you provide your own input logic for common tasks like getting the key or button pressed.

Once you have created your own class, you can just assign it to Terrain Grid System component at runtime like this:

TerrainGridSystem tgs = TerrainGridSystem.instance;
MyCustomInputSystem newInput = new MyCustomInputSystem();
tgs.input = newInput;
Back To Top