Fix input issues

This commit is contained in:
Michal Adam Pikulski
2025-10-21 15:58:13 +02:00
parent 00f6d2c6c6
commit 3aed47b183
6 changed files with 239 additions and 107 deletions

View File

@@ -0,0 +1,36 @@
using UnityEngine;
public class BackpackInput : MonoBehaviour, ITouchInputConsumer
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
public void OnTap(Vector2 position)
{
return;
}
public void OnHoldStart(Vector2 position)
{
return;
}
public void OnHoldMove(Vector2 position)
{
return;
}
public void OnHoldEnd(Vector2 position)
{
return;
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: e7ea50a695c58944799b4f27a9014301

View File

@@ -1,6 +1,7 @@
using AppleHills.Data.CardSystem;
using Core;
using Data.CardSystem;
using Input;
using Pixelplacement;
using UI.Core;
using UnityEngine;
@@ -144,6 +145,10 @@ namespace UI.CardSystem
if (notificationSound != null)
notificationSound.Play();
// Eat input so the characters don't walk around
var backpackInput = backpackIcon.gameObject.GetComponentInParent<BackpackInput>();
InputManager.Instance.RegisterOverrideConsumer(backpackInput);
// If no pages are open, push the main menu
if (_pageController.CurrentPage == null)
{
@@ -177,6 +182,8 @@ namespace UI.CardSystem
if (newPage == null)
{
ShowOnlyBackpackIcon();
var backpackInput = backpackIcon.gameObject.GetComponentInParent<BackpackInput>();
InputManager.Instance.UnregisterOverrideConsumer(backpackInput);
}
else
{