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,140 @@
fileFormatVersion: 2
guid: 0294a084c436048db9ed81eac798a709
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,12 @@
namespace io.github.hatayama.uLoopMCP
{
public enum MouseAction
{
Click = 0,
Drag = 1,
DragStart = 2,
DragMove = 3,
DragEnd = 4,
LongPress = 5
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: d063a5fabb86749b4be11bd2b189db8d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,9 @@
namespace io.github.hatayama.uLoopMCP
{
public static class SimulateMouseUiAnimationConstants
{
public const float EXPAND_DURATION = 0.1f;
public const float EXPAND_START_SCALE = 1.5f;
public const float DISSIPATE_DURATION = 0.1f;
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1b2a42b98d6124b0a828dd71a039d401
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,318 @@
#if UNITY_EDITOR
#nullable enable
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
namespace io.github.hatayama.uLoopMCP
{
// Canvas-based overlay that visualizes SimulateMouseUi cursor position and drag state on Game View.
// Animation is driven externally via SetCursorScale/SetAlpha from async functions in SimulateMouseUiTool.
public class SimulateMouseUiOverlay : MonoBehaviour
{
private const float WAYPOINT_MARKER_DIAMETER = 12f;
private const float LINE_THICKNESS = 2f;
private static readonly Color CLICK_COLOR = new Color(0f, 1f, 0.4f, 0.9f);
private static readonly Color DRAG_COLOR = new Color(1f, 0.6f, 0f, 0.9f);
[SerializeField] private CanvasGroup _canvasGroup = null!;
[SerializeField] private RectTransform _cursorGroup = null!;
[SerializeField] private Image _circleImage = null!;
[SerializeField] private Image _crosshairH = null!;
[SerializeField] private Image _crosshairV = null!;
[SerializeField] private Text _longPressText = null!;
[SerializeField] private Image _dragStartMarker = null!;
[SerializeField] private Sprite _circleSprite = null!;
private readonly List<Image> _pathSegments = new List<Image>();
private readonly List<Image> _waypointMarkers = new List<Image>();
private const float SELF_EXPAND_DURATION = SimulateMouseUiAnimationConstants.EXPAND_DURATION;
private const float SELF_EXPAND_START_SCALE = SimulateMouseUiAnimationConstants.EXPAND_START_SCALE;
private const float SELF_DISSIPATE_DURATION = SimulateMouseUiAnimationConstants.DISSIPATE_DURATION;
private enum SelfAnimState { None, Expanding, Dissipating }
private SelfAnimState _selfAnimState = SelfAnimState.None;
private float _selfAnimStartTime;
private void Awake()
{
Debug.Assert(_canvasGroup != null, "_canvasGroup must be assigned in prefab");
Debug.Assert(_cursorGroup != null, "_cursorGroup must be assigned in prefab");
Debug.Assert(_circleImage != null, "_circleImage must be assigned in prefab");
Debug.Assert(_crosshairH != null, "_crosshairH must be assigned in prefab");
Debug.Assert(_crosshairV != null, "_crosshairV must be assigned in prefab");
Debug.Assert(_longPressText != null, "_longPressText must be assigned in prefab");
Debug.Assert(_dragStartMarker != null, "_dragStartMarker must be assigned in prefab");
Debug.Assert(_circleSprite != null, "_circleSprite must be assigned in prefab");
_canvasGroup!.alpha = 0;
}
private void LateUpdate()
{
ConsumePendingAnimationRequests();
// Dissipate runs independently of overlay state (state is already cleared on release)
if (_selfAnimState == SelfAnimState.Dissipating)
{
float elapsed = Time.realtimeSinceStartup - _selfAnimStartTime;
float t = Mathf.Clamp01(elapsed / SELF_DISSIPATE_DURATION);
_cursorGroup.localScale = Vector3.one * Mathf.Lerp(1f, 0f, t);
_canvasGroup.alpha = Mathf.Lerp(1f, 0f, t);
if (t >= 1f)
{
_selfAnimState = SelfAnimState.None;
_canvasGroup.alpha = 0f;
}
return;
}
if (!SimulateMouseUiOverlayState.IsActive)
{
_canvasGroup.alpha = 0;
return;
}
// SimulateMouseUiTool controls alpha via SetAlpha during animations.
// For non-animated callers (e.g. InputReplayer), auto-show on first active frame.
if (_canvasGroup.alpha == 0f)
{
_canvasGroup.alpha = 1f;
_cursorGroup.localScale = Vector3.one;
}
if (_selfAnimState == SelfAnimState.Expanding)
{
float elapsed = Time.realtimeSinceStartup - _selfAnimStartTime;
float t = Mathf.Clamp01(elapsed / SELF_EXPAND_DURATION);
_cursorGroup.localScale = Vector3.one * Mathf.Lerp(SELF_EXPAND_START_SCALE, 1f, t);
if (t >= 1f)
{
_selfAnimState = SelfAnimState.None;
}
}
UpdateCursorPosition();
UpdateCursorMode();
UpdateDragPath();
}
private void ConsumePendingAnimationRequests()
{
if (SimulateMouseUiOverlayState.ConsumePendingExpandAnimation())
{
_canvasGroup.alpha = 1f;
_cursorGroup.localScale = Vector3.one * SELF_EXPAND_START_SCALE;
_selfAnimState = SelfAnimState.Expanding;
_selfAnimStartTime = Time.realtimeSinceStartup;
}
if (SimulateMouseUiOverlayState.ConsumePendingDissipateAnimation())
{
_selfAnimState = SelfAnimState.Dissipating;
_selfAnimStartTime = Time.realtimeSinceStartup;
}
}
public void SetCursorScale(float scale)
{
_cursorGroup.localScale = Vector3.one * scale;
// SimulateMouseUiTool drives animation externally; cancel any self-driven animation
_selfAnimState = SelfAnimState.None;
}
public void SetAlpha(float alpha)
{
_canvasGroup.alpha = alpha;
_selfAnimState = SelfAnimState.None;
}
// sim coordinate: simX = screen pixel X, simY = EditorScreen.height - canvasY (top-left origin)
// Canvas Screen Space Overlay position: bottom-left origin
private static Vector2 SimToScreen(Vector2 simPos)
{
Vector2 srcSize = SimulateMouseUiOverlayState.SourceScreenSize;
Debug.Assert(srcSize.x > 0f && srcSize.y > 0f, "SourceScreenSize must be set before SimToScreen is called");
return new Vector2(simPos.x, srcSize.y - simPos.y);
}
private void UpdateCursorPosition()
{
Vector2 screenPos = SimToScreen(SimulateMouseUiOverlayState.CurrentPosition);
_cursorGroup.position = new Vector3(screenPos.x, screenPos.y, 0f);
}
private void UpdateCursorMode()
{
bool isLongPress = SimulateMouseUiOverlayState.Action == MouseAction.LongPress;
_crosshairH.enabled = !isLongPress;
_crosshairV.enabled = !isLongPress;
_longPressText.enabled = isLongPress;
if (isLongPress)
{
_longPressText.text = SimulateMouseUiOverlayState.LongPressElapsed.ToString("F1") + "s";
// Pulse the circle between 1.0x and 1.2x scale over a 2-second cycle
float t = Mathf.PingPong(SimulateMouseUiOverlayState.LongPressElapsed, 2f) / 2f;
float scale = Mathf.Lerp(1.0f, 1.2f, t);
_circleImage.rectTransform.localScale = Vector3.one * scale;
}
else
{
_circleImage.rectTransform.localScale = Vector3.one;
}
}
private void UpdateDragPath()
{
if (!SimulateMouseUiOverlayState.DragStartPosition.HasValue)
{
_dragStartMarker.enabled = false;
HidePool(_pathSegments);
HidePool(_waypointMarkers);
// Keep a reasonable number of pooled objects for reuse across drags
TrimPool(_pathSegments, 5);
TrimPool(_waypointMarkers, 4);
return;
}
Color activeColor = GetActiveColor();
// Start marker
Vector2 startScreen = SimToScreen(SimulateMouseUiOverlayState.DragStartPosition.Value);
_dragStartMarker.enabled = true;
_dragStartMarker.color = activeColor;
_dragStartMarker.rectTransform.position = new Vector3(startScreen.x, startScreen.y, 0f);
// Polyline: start → waypoints → current
IReadOnlyList<Vector2> waypoints = SimulateMouseUiOverlayState.DragWaypoints;
Vector2 currentScreen = SimToScreen(SimulateMouseUiOverlayState.CurrentPosition);
int segmentCount = waypoints.Count + 1;
EnsurePoolCount(_pathSegments, segmentCount, CreatePooledSegment);
EnsurePoolCount(_waypointMarkers, waypoints.Count, CreatePooledWaypointMarker);
// All segments fade: oldest = transparent, newest = most visible (but not fully opaque)
float canvasScale = _pathSegments.Count > 0 ? _pathSegments[0].rectTransform.lossyScale.x : 1f;
Vector2 prev = startScreen;
for (int i = 0; i < segmentCount; i++)
{
Vector2 to = (i < waypoints.Count) ? SimToScreen(waypoints[i]) : currentScreen;
float alpha = (float)(i + 1) / (segmentCount + 1);
Color fadedColor = activeColor;
fadedColor.a = activeColor.a * alpha;
DrawSegment(_pathSegments[i], prev, to, fadedColor, canvasScale);
if (i < waypoints.Count)
{
_waypointMarkers[i].enabled = true;
_waypointMarkers[i].color = fadedColor;
_waypointMarkers[i].rectTransform.position = new Vector3(to.x, to.y, 0f);
}
prev = to;
}
HidePoolFrom(_pathSegments, segmentCount);
HidePoolFrom(_waypointMarkers, waypoints.Count);
}
private void DrawSegment(Image line, Vector2 from, Vector2 to, Color color, float canvasScale)
{
Vector2 delta = to - from;
float length = delta.magnitude;
if (length < 1f)
{
line.enabled = false;
return;
}
line.enabled = true;
line.color = color;
float angle = Mathf.Atan2(delta.y, delta.x) * Mathf.Rad2Deg;
RectTransform rect = line.rectTransform;
rect.position = new Vector3(from.x, from.y, 0f);
// sizeDelta is in local space; convert screen-pixel length via lossyScale
rect.sizeDelta = new Vector2(length / canvasScale, LINE_THICKNESS / canvasScale);
rect.localRotation = Quaternion.Euler(0f, 0f, angle);
}
private Image CreatePooledSegment()
{
Image line = CreateImage("PathSegment", gameObject.transform);
line.rectTransform.pivot = new Vector2(0f, 0.5f);
line.rectTransform.sizeDelta = Vector2.zero;
line.enabled = false;
return line;
}
private Image CreatePooledWaypointMarker()
{
Image marker = CreateImage("WaypointMarker", gameObject.transform);
marker.rectTransform.sizeDelta = new Vector2(WAYPOINT_MARKER_DIAMETER, WAYPOINT_MARKER_DIAMETER);
marker.sprite = _circleSprite;
marker.enabled = false;
return marker;
}
private void EnsurePoolCount(List<Image> pool, int count, System.Func<Image> factory)
{
while (pool.Count < count)
{
pool.Add(factory());
}
}
private static void HidePool(List<Image> pool)
{
for (int i = 0; i < pool.Count; i++)
{
pool[i].enabled = false;
}
}
// Pools only grow via EnsurePoolCount; trim excess to prevent unbounded accumulation
private static void TrimPool(List<Image> pool, int maxRetain)
{
while (pool.Count > maxRetain)
{
Image excess = pool[pool.Count - 1];
pool.RemoveAt(pool.Count - 1);
Destroy(excess.gameObject);
}
}
private static void HidePoolFrom(List<Image> pool, int startIndex)
{
for (int i = startIndex; i < pool.Count; i++)
{
pool[i].enabled = false;
}
}
private Color GetActiveColor()
{
return SimulateMouseUiOverlayState.Action == MouseAction.Click
? CLICK_COLOR
: DRAG_COLOR;
}
private static Image CreateImage(string name, Transform parent)
{
GameObject go = new GameObject(name);
go.transform.SetParent(parent, false);
RectTransform rect = go.AddComponent<RectTransform>();
rect.anchorMin = Vector2.zero;
rect.anchorMax = Vector2.zero;
rect.pivot = new Vector2(0.5f, 0.5f);
Image image = go.AddComponent<Image>();
image.raycastTarget = false;
return image;
}
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c4a25f7a1c89649bd9cef96ea292a47e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,507 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3579496036604184255
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 903290766560929725}
- component: {fileID: 4854423239222691101}
- component: {fileID: 2204762901719864460}
m_Layer: 0
m_Name: DragStartMarker
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &903290766560929725
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3579496036604184255}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 5435175328419204271}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 8, y: 8}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4854423239222691101
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3579496036604184255}
m_CullTransparentMesh: 1
--- !u!114 &2204762901719864460
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3579496036604184255}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &3645456351603840414
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1795238667056386859}
m_Layer: 0
m_Name: CursorGroup
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1795238667056386859
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3645456351603840414}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 910718756846548758}
- {fileID: 1713159570844151935}
- {fileID: 7309688806247926274}
- {fileID: 4259856659709602188}
m_Father: {fileID: 5435175328419204271}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &4096853404940709834
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7309688806247926274}
- component: {fileID: 4947376121546195582}
- component: {fileID: 3118357298515763328}
m_Layer: 0
m_Name: CrosshairV
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7309688806247926274
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4096853404940709834}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1795238667056386859}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 3, y: 40}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &4947376121546195582
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4096853404940709834}
m_CullTransparentMesh: 1
--- !u!114 &3118357298515763328
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4096853404940709834}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1}
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &6086391879608123167
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 910718756846548758}
- component: {fileID: 3831445468382753575}
- component: {fileID: 1668577853838809154}
m_Layer: 0
m_Name: Circle
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &910718756846548758
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6086391879608123167}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1795238667056386859}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 70, y: 70}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3831445468382753575
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6086391879608123167}
m_CullTransparentMesh: 1
--- !u!114 &1668577853838809154
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6086391879608123167}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.8}
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: 0294a084c436048db9ed81eac798a709, type: 3}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &7486829258772114075
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1713159570844151935}
- component: {fileID: 6661013875495849459}
- component: {fileID: 2445404945182483613}
m_Layer: 0
m_Name: CrosshairH
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1713159570844151935
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7486829258772114075}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1795238667056386859}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 40, y: 3}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6661013875495849459
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7486829258772114075}
m_CullTransparentMesh: 1
--- !u!114 &2445404945182483613
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7486829258772114075}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1}
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &8398465818153543159
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4259856659709602188}
- component: {fileID: 7692415534472380766}
- component: {fileID: 8021270174096083990}
- component: {fileID: 7159060278707641568}
m_Layer: 0
m_Name: LongPressText
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4259856659709602188
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8398465818153543159}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1795238667056386859}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 140, y: 70}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7692415534472380766
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8398465818153543159}
m_CullTransparentMesh: 1
--- !u!114 &8021270174096083990
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8398465818153543159}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 1}
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 28
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text:
--- !u!114 &7159060278707641568
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8398465818153543159}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e19747de3f5aca642ab2be37e372fb86, type: 3}
m_Name:
m_EditorClassIdentifier:
m_EffectColor: {r: 1, g: 1, b: 1, a: 1}
m_EffectDistance: {x: 1.5, y: -1.5}
m_UseGraphicAlpha: 1
--- !u!1 &9106729417482781781
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5435175328419204271}
- component: {fileID: 7252727134433425355}
- component: {fileID: 6021016629897285075}
m_Layer: 0
m_Name: SimulateMouseUiOverlay
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5435175328419204271
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9106729417482781781}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 903290766560929725}
- {fileID: 1795238667056386859}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!114 &7252727134433425355
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9106729417482781781}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c4a25f7a1c89649bd9cef96ea292a47e, type: 3}
m_Name:
m_EditorClassIdentifier:
_canvasGroup: {fileID: 6021016629897285075}
_cursorGroup: {fileID: 1795238667056386859}
_circleImage: {fileID: 1668577853838809154}
_crosshairH: {fileID: 2445404945182483613}
_crosshairV: {fileID: 3118357298515763328}
_longPressText: {fileID: 8021270174096083990}
_dragStartMarker: {fileID: 2204762901719864460}
_circleSprite: {fileID: 21300000, guid: 0294a084c436048db9ed81eac798a709, type: 3}
--- !u!225 &6021016629897285075
CanvasGroup:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9106729417482781781}
m_Enabled: 1
m_Alpha: 1
m_Interactable: 0
m_BlocksRaycasts: 0
m_IgnoreParentGroups: 0

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: f47ccc1f9351044799d3c9da246db73a
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,118 @@
#nullable enable
using System.Collections.Generic;
using UnityEngine;
namespace io.github.hatayama.uLoopMCP
{
public static class SimulateMouseUiOverlayState
{
public static bool IsActive { get; private set; }
public static MouseAction Action { get; private set; }
public static Vector2 CurrentPosition { get; private set; }
public static Vector2? DragStartPosition { get; private set; }
public static string? HitGameObjectName { get; private set; }
// Screen.width/height at the time positions were recorded (Editor context may differ from Game context)
public static Vector2 SourceScreenSize { get; private set; }
public static float LongPressElapsed { get; private set; }
// Animation request flags survive Clear() — they are consumed by the overlay in LateUpdate
private static bool _pendingExpandAnimation;
private static bool _pendingDissipateAnimation;
private const int MAX_DRAG_WAYPOINTS = 4;
private static readonly List<Vector2> _dragWaypoints = new List<Vector2>();
// Intermediate positions where DragMove stopped, forming a polyline path
public static IReadOnlyList<Vector2> DragWaypoints => _dragWaypoints;
public static void Update(
MouseAction action,
Vector2 currentPosition,
Vector2? dragStartPosition,
string? hitGameObjectName,
Vector2 sourceScreenSize)
{
// PlayDissipateAnimation calls Clear() on normal completion, but a cancelled or stuck drag
// may leave stale waypoints — defensive clear ensures a fresh start
if (action == MouseAction.DragStart || action == MouseAction.Drag)
{
_dragWaypoints.Clear();
}
IsActive = true;
Action = action;
CurrentPosition = currentPosition;
DragStartPosition = dragStartPosition;
HitGameObjectName = hitGameObjectName;
SourceScreenSize = sourceScreenSize;
}
public static void UpdateLongPressElapsed(float elapsed)
{
LongPressElapsed = elapsed;
}
public static void UpdatePosition(Vector2 position)
{
CurrentPosition = position;
}
public static void AddWaypoint(Vector2 position)
{
// Keep only the most recent waypoints to bound overlay draw cost during long drags
if (_dragWaypoints.Count >= MAX_DRAG_WAYPOINTS)
{
_dragWaypoints.RemoveAt(0);
}
_dragWaypoints.Add(position);
}
public static void RequestExpandAnimation()
{
_pendingExpandAnimation = true;
}
public static void RequestDissipateAnimation()
{
_pendingDissipateAnimation = true;
}
public static bool ConsumePendingExpandAnimation()
{
if (!_pendingExpandAnimation)
{
return false;
}
_pendingExpandAnimation = false;
return true;
}
public static bool ConsumePendingDissipateAnimation()
{
if (!_pendingDissipateAnimation)
{
return false;
}
_pendingDissipateAnimation = false;
return true;
}
public static void Clear()
{
IsActive = false;
Action = default;
CurrentPosition = Vector2.zero;
DragStartPosition = null;
HitGameObjectName = null;
SourceScreenSize = Vector2.zero;
LongPressElapsed = 0f;
_dragWaypoints.Clear();
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 79bc949237a954d0dac73dae3ce9c496
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: