Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using AC;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class DetectInputMethod : MonoBehaviour
- {
- private void Update()
- {
- Event currentEvent = Event.current;
- if (currentEvent.isMouse)
- {
- SetInputMethod(InputMethod.MouseAndKeyboard);
- }
- else
- {
- SetInputMethod(InputMethod.KeyboardOrController);
- }
- }
- private void SetInputMethod(InputMethod inputMethod)
- {
- if (KickStarter.settingsManager.inputMethod != inputMethod)
- {
- KickStarter.settingsManager.inputMethod = inputMethod;
- // Plus anything else you may want/need to do when changing input
- }
- }
- }
Add Comment
Please, Sign In to add comment