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,109 @@
#if UNITY_EDITOR
#nullable enable
using UnityEngine;
using UnityEngine.UI;
namespace io.github.hatayama.uLoopMCP
{
// Overlay that displays replay progress (frame counter and progress bar)
// during input replay. Keyboard/mouse visualization is handled by existing
// SimulateKeyboardOverlay and SimulateMouseInputOverlay.
public class ReplayInputOverlay : MonoBehaviour
{
private const float FADE_OUT_DURATION = 0.5f;
[SerializeField] private Text? _statusText;
[SerializeField] private Image? _progressBarFill;
[SerializeField] private GameObject? _loopIcon;
private CanvasGroup _canvasGroup = null!;
private bool _wasActive;
private float _deactivatedTime;
private void Awake()
{
_canvasGroup = GetComponent<CanvasGroup>();
if (_canvasGroup == null)
{
_canvasGroup = gameObject.AddComponent<CanvasGroup>();
}
_canvasGroup.interactable = false;
_canvasGroup.blocksRaycasts = false;
SetVisible(false);
}
private void LateUpdate()
{
if (ReplayInputOverlayState.IsActive)
{
_wasActive = true;
_deactivatedTime = 0f;
SetVisible(true);
UpdateDisplay();
return;
}
if (!_wasActive)
{
return;
}
float elapsed = Time.realtimeSinceStartup - _deactivatedTime;
if (_deactivatedTime <= 0f)
{
_deactivatedTime = Time.realtimeSinceStartup;
UpdateStatusText("REPLAY COMPLETE");
return;
}
if (elapsed > FADE_OUT_DURATION)
{
SetVisible(false);
_wasActive = false;
_deactivatedTime = 0f;
return;
}
float alpha = 1f - (elapsed / FADE_OUT_DURATION);
_canvasGroup.alpha = alpha;
}
private void UpdateDisplay()
{
int currentFrame = ReplayInputOverlayState.CurrentFrame;
int totalFrames = ReplayInputOverlayState.TotalFrames;
bool isLooping = ReplayInputOverlayState.IsLooping;
string loopLabel = isLooping ? " \u21BB" : "";
UpdateStatusText($"REPLAY {currentFrame} / {totalFrames}{loopLabel}");
if (_progressBarFill != null)
{
Vector3 scale = _progressBarFill.rectTransform.localScale;
scale.x = ReplayInputOverlayState.Progress;
_progressBarFill.rectTransform.localScale = scale;
}
if (_loopIcon != null)
{
_loopIcon.SetActive(isLooping);
}
}
private void UpdateStatusText(string text)
{
if (_statusText != null)
{
_statusText.text = text;
}
}
private void SetVisible(bool visible)
{
_canvasGroup.alpha = visible ? 1f : 0f;
}
}
}
#endif

View File

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

View File

@@ -0,0 +1,338 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3143306149169442488
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4495645932648773490}
- component: {fileID: 8257633976371616988}
- component: {fileID: 7305657527396605225}
m_Layer: 0
m_Name: StatusText
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &4495645932648773490
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3143306149169442488}
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: 1866048660558847936}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -20, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8257633976371616988
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3143306149169442488}
m_CullTransparentMesh: 1
--- !u!114 &7305657527396605225
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3143306149169442488}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.3, g: 1, b: 0.5, a: 1}
m_RaycastTarget: 1
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: 24
m_FontStyle: 1
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 42
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: REPLAY 0 / 0
--- !u!1 &4291754732258876827
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1866048660558847936}
- component: {fileID: 8861507738235532311}
- component: {fileID: 6556589926453698892}
- component: {fileID: 7623582385403064619}
- component: {fileID: 750881311793061267}
m_Layer: 0
m_Name: ReplayInputOverlay
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1866048660558847936
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4291754732258876827}
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: 4495645932648773490}
- {fileID: 8766924675270495938}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: 0, y: 10}
m_SizeDelta: {x: 300, y: 40}
m_Pivot: {x: 0.5, y: 0}
--- !u!225 &8861507738235532311
CanvasGroup:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4291754732258876827}
m_Enabled: 1
m_Alpha: 1
m_Interactable: 0
m_BlocksRaycasts: 0
m_IgnoreParentGroups: 0
--- !u!222 &6556589926453698892
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4291754732258876827}
m_CullTransparentMesh: 1
--- !u!114 &7623582385403064619
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4291754732258876827}
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: 0.6}
m_RaycastTarget: 1
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!114 &750881311793061267
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4291754732258876827}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7d029ac853dd64fdab15fa5c78ced267, type: 3}
m_Name:
m_EditorClassIdentifier:
_statusText: {fileID: 7305657527396605225}
_progressBarFill: {fileID: 5900655728717313438}
_loopIcon: {fileID: 0}
--- !u!1 &5842103157894414940
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8766924675270495938}
- component: {fileID: 5317892433336956793}
- component: {fileID: 699221967987577222}
m_Layer: 0
m_Name: ProgressBarBg
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &8766924675270495938
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5842103157894414940}
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: 3633262302885763002}
m_Father: {fileID: 1866048660558847936}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0.4}
m_AnchoredPosition: {x: 0, y: 10}
m_SizeDelta: {x: -20, y: 3.9999}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5317892433336956793
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5842103157894414940}
m_CullTransparentMesh: 1
--- !u!114 &699221967987577222
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5842103157894414940}
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.2, g: 0.2, b: 0.2, a: 0.8}
m_RaycastTarget: 1
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 &8320914726685114482
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3633262302885763002}
- component: {fileID: 3929436855382297907}
- component: {fileID: 5900655728717313438}
m_Layer: 0
m_Name: ProgressBarFill
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3633262302885763002
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8320914726685114482}
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: 8766924675270495938}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0.5}
--- !u!222 &3929436855382297907
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8320914726685114482}
m_CullTransparentMesh: 1
--- !u!114 &5900655728717313438
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8320914726685114482}
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.3, g: 1, b: 0.5, a: 0.9}
m_RaycastTarget: 1
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: 0
m_FillAmount: 0
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1

View File

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

View File

@@ -0,0 +1,41 @@
#nullable enable
namespace io.github.hatayama.uLoopMCP
{
public static class ReplayInputOverlayState
{
private static bool _isActive;
private static int _currentFrame;
private static int _totalFrames;
private static bool _isLooping;
public static bool IsActive => _isActive;
public static int CurrentFrame => _currentFrame;
public static int TotalFrames => _totalFrames;
public static bool IsLooping => _isLooping;
public static float Progress
{
get
{
return _totalFrames > 0 ? (float)_currentFrame / _totalFrames : 0f;
}
}
public static void Update(int currentFrame, int totalFrames, bool isLooping)
{
_isActive = true;
_currentFrame = currentFrame;
_totalFrames = totalFrames;
_isLooping = isLooping;
}
public static void Clear()
{
_isActive = false;
_currentFrame = 0;
_totalFrames = 0;
_isLooping = false;
}
}
}

View File

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