Skip to content

Instantly share code, notes, and snippets.

@sim2kid
sim2kid / StadiaController.cs
Last active June 27, 2024 22:31
Google Stadia Controller Support in Unity's New Input System (1.2+) With full button mapping. Haptics not supported. You should be able to drag and drop this in your project for Stadia controller support
using UnityEditor;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Layouts;
[InputControlLayout(stateType = typeof(StadiaControllerState))]
#if UNITY_EDITOR
[InitializeOnLoad] // Make sure static constructor is called during startup.
#endif
public class StadiaController : Gamepad