完成交互逻辑
This commit is contained in:
@@ -16,7 +16,8 @@ namespace NBF
|
||||
|
||||
public static event Action<bool> OnOp1Action;
|
||||
public static event Action<bool> OnOp2Action;
|
||||
public static event Action<bool> OnUseAction;
|
||||
public static event Action OnUseAction;
|
||||
public static event Action OnUse2Action;
|
||||
public static event Action<bool> OnSelectItemAction;
|
||||
public static event Action<bool> OnSelectBaitAction;
|
||||
public static event Action<bool> OnSelectFoodAction;
|
||||
@@ -148,6 +149,8 @@ namespace NBF
|
||||
PlayerInputControl.Normal.Op2.canceled += OnOp2;
|
||||
PlayerInputControl.Normal.Use.performed += OnUse;
|
||||
PlayerInputControl.Normal.Use.canceled += OnUse;
|
||||
PlayerInputControl.Normal.Use2.performed += OnUse2;
|
||||
PlayerInputControl.Normal.Use2.canceled += OnUse2;
|
||||
|
||||
PlayerInputControl.Normal.SelectItem.performed += OnSelectItem;
|
||||
PlayerInputControl.Normal.SelectItem.canceled += OnSelectItem;
|
||||
@@ -221,6 +224,8 @@ namespace NBF
|
||||
PlayerInputControl.Normal.Op2.canceled -= OnOp2;
|
||||
PlayerInputControl.Normal.Use.performed -= OnUse;
|
||||
PlayerInputControl.Normal.Use.canceled -= OnUse;
|
||||
PlayerInputControl.Normal.Use2.performed -= OnUse2;
|
||||
PlayerInputControl.Normal.Use2.canceled -= OnUse2;
|
||||
|
||||
PlayerInputControl.Normal.SelectItem.performed -= OnSelectItem;
|
||||
PlayerInputControl.Normal.SelectItem.canceled -= OnSelectItem;
|
||||
@@ -311,7 +316,18 @@ namespace NBF
|
||||
|
||||
private void OnUse(InputAction.CallbackContext context)
|
||||
{
|
||||
OnUseAction?.Invoke(context.performed);
|
||||
if (context.performed)
|
||||
{
|
||||
OnUseAction?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnUse2(InputAction.CallbackContext context)
|
||||
{
|
||||
if (context.performed)
|
||||
{
|
||||
OnUse2Action?.Invoke();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSelectItem(InputAction.CallbackContext context)
|
||||
|
||||
Reference in New Issue
Block a user