kgc00
4 年前
当前提交
801e2d62
共有 5 个文件被更改,包括 78 次插入 和 77 次删除
-
43UOP1_Project/Assets/Scripts/Input/InputReader.cs
-
10UOP1_Project/Assets/Scripts/Menu/MenuInput.cs
-
45UOP1_Project/Assets/Scripts/Menu/SelectableUIElement.cs
-
46UOP1_Project/Assets/Scripts/Input/MenuInputReader.cs
-
11UOP1_Project/Assets/Scripts/Input/MenuInputReader.cs.meta
|
|||
using UnityEngine.Events; |
|||
using UnityEngine.InputSystem; |
|||
|
|||
public class MenuInputReader: GameInput.IMenusActions |
|||
{ |
|||
public MenuInputReader(GameInput gameInput) |
|||
{ |
|||
gameInput.Menus.SetCallbacks(this); |
|||
} |
|||
|
|||
// MenuEvents
|
|||
public event UnityAction MoveSelectionMenuEvent = delegate { }; |
|||
public event UnityAction MouseMoveMenuEvent = delegate { }; |
|||
public event UnityAction ConfirmMenuEvent = delegate { }; |
|||
public event UnityAction CancelMenuEvent = delegate { }; |
|||
public event UnityAction CloseMenuEvent = delegate { }; |
|||
public void OnMoveSelection(InputAction.CallbackContext context) |
|||
{ |
|||
if (context.phase == InputActionPhase.Performed) |
|||
MoveSelectionMenuEvent(); |
|||
} |
|||
|
|||
public void OnConfirm(InputAction.CallbackContext context) |
|||
{ |
|||
if (context.phase == InputActionPhase.Performed) |
|||
ConfirmMenuEvent(); |
|||
} |
|||
|
|||
public void OnCancel(InputAction.CallbackContext context) |
|||
{ |
|||
if (context.phase == InputActionPhase.Performed) |
|||
CancelMenuEvent(); |
|||
} |
|||
|
|||
public void OnMouseMove(InputAction.CallbackContext context) |
|||
{ |
|||
if (context.phase == InputActionPhase.Performed) |
|||
MouseMoveMenuEvent(); |
|||
} |
|||
|
|||
public void OnCloseMenu(InputAction.CallbackContext context) |
|||
{ |
|||
if (context.phase == InputActionPhase.Performed) |
|||
CloseMenuEvent(); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 028af03e2ac34463b1c2b1ba0ee23809 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue