public void Start() { #if UNITY_EDITOR || UNITY_STANDALONE_WIN || UNITY_STANDALONE _inputController = new KeyboardController(); #endif #if UNITY_ANDROID && !UNITY_EDITOR _inputController = new TouchController(); #endif _inputController.TapEvent += TapEvent; _inputController.SwipeUpEvent += SwipeUpEvent; _inputController.SwipeDownEvent += SwipeDownEvent; _inputController.SwipeLeftEvent += SwipeLeftEvent; _inputController.SwipeRightEvent += SwipeRightEvent; _inputController.SwipeUpOverEvent += SwipeUpOverEvent; _inputController.SwipeDownOverEvent += SwipeDownOverEvent; _inputController.SwipeLeftOverEvent += SwipeLeftOverEvent; _inputController.SwipeRightOverEvent += SwipeRightOverEvent; }
/// <summary> /// Unregisters an object from Input update. /// </summary> public void Unregister(IInputUpdate _update) => inputUpdates.Remove(_update);
// ------------------------------ /// <summary> /// Registers an object on Input update. /// </summary> public void Register(IInputUpdate _update) => inputUpdates.Add(_update);