This commit is contained in:
CortexCore
2023-10-24 23:37:59 +08:00
parent 325f63d6bc
commit 3e39e627bc
388 changed files with 29043 additions and 889 deletions

View File

@@ -15,6 +15,7 @@ using BITKit.SceneManagement;
using BITKit.Selection;
using BITKit.Steamwork;
using UnityEditor;
using UnityEngine.InputSystem.Interactions;
namespace BITFALL.UX
{
@@ -38,9 +39,8 @@ namespace BITFALL.UX
[SerializeField] private UXBar armorBar;
[Header(Constant.Header.Input)]
public InputActionReference inventoryAction;
public InputActionReference returnAction;
public InputActionGroup inputActionGroup = new();
[SerializeField] private InputActionReference inventoryAction;
[SerializeField] private InputActionReference returnAction;
[Inject]
private IHealth _health;
@@ -71,11 +71,6 @@ namespace BITFALL.UX
{
playerService.OnPlayerInitialized -= OnPlayerInitializedLocalPlayer;
}
protected override void OnEntryOrExit(bool isEntry)
{
inputActionGroup.RegisterCallback(inventoryAction, OnInventory);
inputActionGroup.allowInput.SetElements(this, isEntry);
}
public void OnActive(ISelectable selectable)
{
seleableLabel.SetActive(false);
@@ -131,7 +126,7 @@ namespace BITFALL.UX
{
if(playerService.LocalPlayer is null) return;
if(_health.IsAlive is false) return;
if(context.JustPressed())
if(context is {interaction:PressInteraction,performed:true})
UXService.Entry<UXInventory>();
}