更新
This commit is contained in:
@@ -127,10 +127,6 @@ public class GameInputManager : MonoBehaviour
|
||||
|
||||
GameManager.instance.noteJudgeManager.SetNewInputUnitSwipe(id, position, isGeneric, isFirst, direction);
|
||||
}
|
||||
|
||||
// =====================================================================
|
||||
// 核心处理逻辑 (Core Processing Logic)
|
||||
// =====================================================================
|
||||
|
||||
#if UNITY_STANDALONE
|
||||
/// <summary>
|
||||
@@ -315,7 +311,7 @@ public class GameInputManager : MonoBehaviour
|
||||
if (holdingSwipe0)
|
||||
{
|
||||
Vector2 inputPosition = new Vector2(Screen.width * 0.5f, 200f);
|
||||
OnSwipe(0, inputPosition, true, Vector2.zero);
|
||||
OnSwipe(0, inputPosition, true, false, Vector2.zero);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -362,8 +358,7 @@ public class GameInputManager : MonoBehaviour
|
||||
if (_activeTouches.TryGetValue(touchId, out TouchState movedState))
|
||||
{
|
||||
OnTouch(touchId, position);
|
||||
DetectSwipe(movedState, _activeTouches[touchId].isFirstSwipe, position);
|
||||
//_activeTouches[touchId].isFirstSwipe = false;
|
||||
DetectSwipe(movedState, position);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -401,7 +396,7 @@ public class GameInputManager : MonoBehaviour
|
||||
/// <summary>
|
||||
/// 检测划动逻辑 (无需修改)
|
||||
/// </summary>
|
||||
private void DetectSwipe(TouchState state, bool isFirst, Vector2 currentPosition)
|
||||
private void DetectSwipe(TouchState state, Vector2 currentPosition)
|
||||
{
|
||||
Vector2 swipeVector = currentPosition - state.StartPosition;
|
||||
if (swipeVector.magnitude < minSwipeDistance) return;
|
||||
@@ -411,10 +406,11 @@ public class GameInputManager : MonoBehaviour
|
||||
// 检查是否是新的划动方向
|
||||
if (Vector2.Dot(direction, state.LastSwipeDirection) <= swipeAngleThreshold)
|
||||
{
|
||||
OnSwipe(state.TouchId, state.StartPosition, false, isFirst, direction);
|
||||
OnSwipe(state.TouchId, state.StartPosition, false, state.isFirstSwipe, direction);
|
||||
state.LastSwipeDirection = direction;
|
||||
state.StartPosition = currentPosition;
|
||||
state.StartTime = Time.time;
|
||||
state.isFirstSwipe = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user