浏览代码

Fixes when New Input System is not present

/feature-new-input-system
Thomas ICHÉ 3 年前
当前提交
c6ce5080
共有 3 个文件被更改,包括 10 次插入5 次删除
  1. 2
      Runtime/Input/InputSystemUtility.cs
  2. 11
      Runtime/LevelScripting/Events/OnInputDirectEvent.cs
  3. 2
      Runtime/Managers/Implementations/UIEventManager.cs

2
Runtime/Input/InputSystemUtility.cs


#if ENABLE_INPUT_SYSTEM
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
#endif
#if ENABLE_INPUT_SYSTEM
public static ButtonControl GetButton(MouseButton b)
{
Mouse m = Mouse.current;

11
Runtime/LevelScripting/Events/OnInputDirectEvent.cs


[AddComponentMenu(ComponentMenu.eventsPath + "On Input Direct Event (New Input System)")]
public class OnInputDirectEvent : EventBase
{
#if ENABLE_INPUT_SYSTEM
[SerializeField]
Device device = Device.Keyboard;
[SerializeField, ShowIf("IsMouse")]

[SerializeField, ShowIf("IsKeyboard")]
Key keyboardKey = Key.Space;
bool IsMouse() => device == Device.Mouse;
bool IsGamepad() => device == Device.Gamepad;
bool IsKeyboard() => device == Device.Keyboard;
#endif
bool IsMouse() => device == Device.Mouse;
bool IsGamepad() => device == Device.Gamepad;
bool IsKeyboard() => device == Device.Keyboard;
ButtonControl button;
ButtonControl button;
private void OnEnable()
{

2
Runtime/Managers/Implementations/UIEventManager.cs


#if ENABLE_INPUT_SYSTEM
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.UI;
using UnityEngine.UI;
using UnityEngine.UI;
namespace GameplayIngredients
{

正在加载...
取消
保存