|
|
|
|
|
|
[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() |
|
|
|
{ |
|
|
|