Fix input issues
This commit is contained in:
36
Assets/Scripts/BackpackInput.cs
Normal file
36
Assets/Scripts/BackpackInput.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/BackpackInput.cs.meta
Normal file
2
Assets/Scripts/BackpackInput.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e7ea50a695c58944799b4f27a9014301
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user