Restore free-play cancellation prompt and map emulator touch coordinates

This commit is contained in:
NINI
2026-10-05 05:28:49 +09:00
parent e5f19d6fef
commit e924e697a2
5 changed files with 7 additions and 9 deletions
@@ -91,6 +91,8 @@ namespace MagnetismHeroes.Tests
Assert.That(Vector3.Distance(_app.Presenter.Balls[states[0].id].transform.position, _app.Presenter.Balls[states[1].id].transform.position), Is.EqualTo(1).Within(.001f));
Assert.That(_app.Presenter.Balls.Values.All(ball => !ball.ContactCandidate), Is.True);
Assert.That(_app.GetComponentsInChildren<GroupBadge>().Length, Is.EqualTo(1));
Tap(states[0].id); _app.Input.BeginSplit(); Tap(states[0].id); _app.Input.CancelSplit();
Assert.That(_app.Instruction, Is.EqualTo("해냈어! 친구와 자유롭게 놀아 보자."));
}
[UnityTest] public IEnumerator FourteenDisconnectedSelectionThenMergeIsAcceptedByFinalNumbers()
{
@@ -142,6 +142,7 @@ namespace MagnetismHeroes.UnityRuntime.Bootstrap
_cancelSplitButton.gameObject.SetActive(_input.IsSplitting);
if (_input.IsSplitting) _instruction.text = $"선택 {_input.SelectedCount} · 구를 골라 끌어내 보자.";
else if (Session.Board?.Mode == BoardMode.Composition) _instruction.text = "붙이거나 나누어 목표 친구를 만들어 보자.";
else if (Session.Board?.Mode == BoardMode.FreePlay) _instruction.text = "해냈어! 친구와 자유롭게 놀아 보자.";
_presenter.ShowSelection(_input.SelectedIds);
}
private void OnApplicationPause(bool paused)
@@ -33,8 +33,6 @@ namespace MagnetismHeroes.UnityRuntime.Interaction
private float _pinchDistance;
private int _fingerId = -1;
private bool _waitForAllTouchesReleased;
private int _diagnosticEvents;
private bool _diagnosticReady;
private int _pinchFirstId = -1, _pinchSecondId = -1;
private readonly struct TouchContact
{
@@ -164,7 +162,6 @@ namespace MagnetismHeroes.UnityRuntime.Interaction
private void RecordTouch(Finger finger)
{
if (AcceptInput && _diagnosticEvents++ < 16) Debug.Log($"[CompositionInput] callback {finger.lastTouch.phase} screen={finger.screen?.name} current={Touchscreen.current?.name} gesture={_gesture}");
if (!AcceptInput || finger.screen != Touchscreen.current) return;
// Copy each official history callback before later events overwrite the native touch slot.
var touch = finger.lastTouch;
@@ -231,7 +228,6 @@ namespace MagnetismHeroes.UnityRuntime.Interaction
private void Update()
{
if (AcceptInput && !_diagnosticReady) { _diagnosticReady = true; Debug.Log($"[CompositionInput] ready enabled={enabled} touchscreen={Touchscreen.current?.name} enhanced={EnhancedTouchSupport.enabled}"); }
if (!AcceptInput) { _touchEvents.Clear(); _touches.Clear(); return; }
bool hadTouches = _touchEvents.Count > 0, suppressRestOfFrame = false;
while (_touchEvents.Count > 0)
@@ -259,7 +255,6 @@ namespace MagnetismHeroes.UnityRuntime.Interaction
}
private void OnEnable()
{
Debug.Log("[CompositionInput] subscribing");
EnhancedTouchSupport.Enable();
UnityEngine.InputSystem.EnhancedTouch.Touch.onFingerDown += RecordTouch;
UnityEngine.InputSystem.EnhancedTouch.Touch.onFingerMove += RecordTouch;