private void GetController() { if (MLInput.IsStarted && connector?.ConnectedController != null) { Device = connector.ConnectedController; MLInput.OnControllerButtonDown += MLInput_OnControllerButtonDown; MLInput.OnControllerButtonUp += MLInput_OnControllerButtonUp; Haptics.SetController(Device); } }
public void OnDestroy() { if (IsConnected) { Haptics.SetController(null); CleanupConnector(false); MLInput.OnControllerButtonDown -= MLInput_OnControllerButtonDown; MLInput.OnControllerButtonUp -= MLInput_OnControllerButtonUp; Device = null; } }