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

@@ -1,84 +1,5 @@
%YAML 1.1 %YAML 1.1
%TAG !u! tag:unity3d.com,2011: %TAG !u! tag:unity3d.com,2011:
--- !u!1 &303625417641854305
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1369814279180176174}
- component: {fileID: 9169434787445119839}
- component: {fileID: 519551942242793934}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1369814279180176174
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 303625417641854305}
serializedVersion: 2
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -1024, y: -768, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 7586531588264964688}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &9169434787445119839
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 303625417641854305}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.EventSystems.EventSystem
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 10
--- !u!114 &519551942242793934
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 303625417641854305}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 01614664b831546d2ae94a42149d80ac, type: 3}
m_Name:
m_EditorClassIdentifier: Unity.InputSystem::UnityEngine.InputSystem.UI.InputSystemUIInputModule
m_SendPointerHoverToParent: 1
m_MoveRepeatDelay: 0.5
m_MoveRepeatRate: 0.1
m_XRTrackingOrigin: {fileID: 0}
m_ActionsAsset: {fileID: -944628639613478452, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_PointAction: {fileID: -1654692200621890270, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_MoveAction: {fileID: -8784545083839296357, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_SubmitAction: {fileID: 392368643174621059, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_CancelAction: {fileID: 7727032971491509709, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_LeftClickAction: {fileID: 3001919216989983466, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_MiddleClickAction: {fileID: -2185481485913320682, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_RightClickAction: {fileID: -4090225696740746782, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_ScrollWheelAction: {fileID: 6240969308177333660, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_TrackedDevicePositionAction: {fileID: 6564999863303420839, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_TrackedDeviceOrientationAction: {fileID: 7970375526676320489, guid: ca9f5fa95ffab41fb9a615ab714db018, type: 3}
m_DeselectOnBackgroundClick: 1
m_PointerBehavior: 0
m_CursorLockBehavior: 0
m_ScrollDeltaPerTick: 6
--- !u!1 &5376380915675871979 --- !u!1 &5376380915675871979
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -264,7 +185,6 @@ RectTransform:
m_Children: m_Children:
- {fileID: 8855931927481658112} - {fileID: 8855931927481658112}
- {fileID: 4224770106652410837} - {fileID: 4224770106652410837}
- {fileID: 1369814279180176174}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
@@ -379,6 +299,7 @@ GameObject:
m_Component: m_Component:
- component: {fileID: 8855931927481658112} - component: {fileID: 8855931927481658112}
- component: {fileID: 5244731468946939147} - component: {fileID: 5244731468946939147}
- component: {fileID: 2860077094930428643}
m_Layer: 5 m_Layer: 5
m_Name: Backback m_Name: Backback
m_TagString: Untagged m_TagString: Untagged
@@ -451,6 +372,18 @@ MonoBehaviour:
m_OnClick: m_OnClick:
m_PersistentCalls: m_PersistentCalls:
m_Calls: [] m_Calls: []
--- !u!114 &2860077094930428643
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7564017895147059150}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e7ea50a695c58944799b4f27a9014301, type: 3}
m_Name:
m_EditorClassIdentifier: '::'
--- !u!1 &8561999612656273135 --- !u!1 &8561999612656273135
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@@ -594,7 +527,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!224 &97355368880614441 --- !u!224 &97355368880614441
RectTransform: RectTransform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

File diff suppressed because one or more lines are too long

View File

@@ -410,10 +410,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z propertyPath: m_LocalEulerAnglesHint.z
value: 0 value: 0
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 8881813093512315793, guid: 840f3d8a936b39a41b5896328a692005, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []
m_AddedGameObjects: [] m_AddedGameObjects: []

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 AppleHills.Data.CardSystem;
using Core; using Core;
using Data.CardSystem; using Data.CardSystem;
using Input;
using Pixelplacement; using Pixelplacement;
using UI.Core; using UI.Core;
using UnityEngine; using UnityEngine;
@@ -144,6 +145,10 @@ namespace UI.CardSystem
if (notificationSound != null) if (notificationSound != null)
notificationSound.Play(); 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 no pages are open, push the main menu
if (_pageController.CurrentPage == null) if (_pageController.CurrentPage == null)
{ {
@@ -177,6 +182,8 @@ namespace UI.CardSystem
if (newPage == null) if (newPage == null)
{ {
ShowOnlyBackpackIcon(); ShowOnlyBackpackIcon();
var backpackInput = backpackIcon.gameObject.GetComponentInParent<BackpackInput>();
InputManager.Instance.UnregisterOverrideConsumer(backpackInput);
} }
else else
{ {