chore(unity): 固定Unity CLI Loop本地包并移除UnitySkills依赖

This commit is contained in:
Liubing\LB
2026-09-28 18:14:59 +08:00
parent 0eb43b2b40
commit c4ae02def9
952 changed files with 70137 additions and 11 deletions

View File

@@ -0,0 +1,38 @@
#nullable enable
using UnityEditor;
using UnityEngine;
using UnityEngine.EventSystems;
namespace io.github.hatayama.uLoopMCP
{
// Tool instances are created fresh per invocation, so drag state
// between DragStart/DragMove/DragEnd must be held statically.
[InitializeOnLoad]
internal static class MouseDragState
{
internal static bool IsDragging => Target != null && PointerData != null;
internal static GameObject? Target { get; set; }
internal static PointerEventData? PointerData { get; set; }
static MouseDragState()
{
// PlayMode exit leaves dangling references to destroyed GameObjects
EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
}
internal static void Clear()
{
Target = null;
PointerData = null;
}
private static void OnPlayModeStateChanged(PlayModeStateChange state)
{
if (state == PlayModeStateChange.ExitingPlayMode)
{
Clear();
SimulateMouseUiOverlayState.Clear();
}
}
}
}