chore(unity): 固定Unity CLI Loop本地包并移除UnitySkills依赖
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
---
|
||||
name: uloop-replay-input
|
||||
description: "Replay recorded PlayMode keyboard and mouse input. Use for exact gameplay reproduction, E2E runs, or consistent demos from JSON recordings."
|
||||
---
|
||||
|
||||
# uloop replay-input
|
||||
|
||||
Replay recorded keyboard and mouse input during PlayMode. Loads a JSON recording and injects input frame-by-frame via Input System with zero CLI overhead. Supports looping and progress monitoring.
|
||||
|
||||
## Usage
|
||||
|
||||
```bash
|
||||
# Start replay (auto-detect latest recording)
|
||||
uloop replay-input --action Start
|
||||
|
||||
# Start replay with specific file
|
||||
uloop replay-input --action Start --input-path scripts/my-play.json
|
||||
|
||||
# Start replay with looping
|
||||
uloop replay-input --action Start --loop true
|
||||
|
||||
# Check replay progress
|
||||
uloop replay-input --action Status
|
||||
|
||||
# Stop replay
|
||||
uloop replay-input --action Stop
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
|-----------|------|---------|-------------|
|
||||
| `--action` | enum | `Start` | `Start`, `Stop`, `Status` |
|
||||
| `--input-path` | string | auto | JSON path. Auto-detects latest in `.uloop/outputs/InputRecordings/` |
|
||||
| `--show-overlay` | boolean | `true` | Show replay progress overlay |
|
||||
| `--loop` | boolean | `false` | Loop continuously |
|
||||
|
||||
## Deterministic Replay
|
||||
|
||||
Replay injects the exact same input frame-by-frame, but the game must also be deterministic to produce identical results. If replay output must be compared across runs, read [references/deterministic-replay.md](references/deterministic-replay.md) before interpreting failures.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Unity must be in **PlayMode**
|
||||
- **Input System package** must be installed (`com.unity.inputsystem`)
|
||||
- Use this only when the project already uses the New Input System.
|
||||
|
||||
## Output
|
||||
|
||||
Returns JSON with:
|
||||
- `Success`: Whether the operation succeeded
|
||||
- `Message`: Status message
|
||||
- `Action`: Echoes which action was executed (`Start`, `Stop`, or `Status`)
|
||||
- `InputPath`: Path to recording file (nullable string; populated on `Start` only)
|
||||
- `CurrentFrame`: Current replay frame index (nullable int)
|
||||
- `TotalFrames`: Total frames in the recording (nullable int)
|
||||
- `Progress`: Replay progress (nullable float in 0.0 – 1.0)
|
||||
- `IsReplaying`: Whether replay is currently active (nullable bool)
|
||||
|
||||
These are the only eight fields. There is no `LoopCount`, `ElapsedSeconds`, `OverlayVisible`, or per-frame inspection data in the response.
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d413553edea5f45158e4adf599a059df
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b8ef7887274da4fa5bfcad96ea3d6281
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,15 @@
|
||||
# Deterministic Replay
|
||||
|
||||
Replay injects input frame-by-frame, so the game must produce identical results given identical input on each run. The following patterns break determinism and should be avoided in replay-targeted code:
|
||||
|
||||
| Avoid | Use Instead | Why |
|
||||
|-------|-------------|-----|
|
||||
| `Time.deltaTime` for movement | Fixed per-frame constant (e.g. `MOVE_SPEED = 0.1f`) | Delta time varies between runs even at the same target frame rate |
|
||||
| `Random.Range()` / `UnityEngine.Random` | Seeded random (`new System.Random(fixedSeed)`) or remove randomness | Random sequences differ between runs |
|
||||
| `Rigidbody` / Physics simulation | Kinematic movement via `Transform.Translate` | Physics is non-deterministic across runs |
|
||||
| `WaitForSeconds(n)` in coroutines | `WaitForEndOfFrame` or frame counting | Real-time waits depend on frame timing |
|
||||
| `Time.time` / `Time.realtimeSinceStartup` | Frame counter (`Time.frameCount - startFrame`) | Time values drift between runs |
|
||||
| `FindObjectsOfType` without sort | `FindObjectsByType(FindObjectsSortMode.InstanceID)` | Iteration order is non-deterministic |
|
||||
| `async/await` with `Task.Delay` | Frame-based waiting | Real-time delays are non-deterministic |
|
||||
|
||||
Set `Application.targetFrameRate = 60` or another fixed target to reduce frame timing variance. See `InputReplayVerificationController` for a complete example of deterministic game logic.
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: af36ab88f77db43a4b6b3ef19dd4432b
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user