From 7fc1511fd44707dec908fdc704f6c554b2eb53a3 Mon Sep 17 00:00:00 2001 From: ritenseki Date: Thu, 7 May 2026 20:19:45 +0800 Subject: [PATCH] Fix StageController light filter: use explicit patterns instead of Contains("light") Replace broad Contains("light") with IsTimelineControlledLight() that matches only objects actually controlled by timeline handlers (blinklight, spotlight3d, _wash_, laser). Neonsigns, glow meshes, UV scroll objects and other static stage props now keep their prefab default state instead of being silently disabled. Also fix UVScrollLight handler to use GetComponentsInChildren(true) so inactive renderers are included in material search. Co-Authored-By: Claude Sonnet 4.6 --- Assets/Scripts/umamusume/Gallop/Live/Director.cs | 2 +- .../Scripts/umamusume/Gallop/Live/StageController.cs | 12 ++++++++++-- CLAUDE.md | 5 +++-- LIVE_DEV_MAP.md | 5 ++--- LIVE_TRACKS.md | 4 ++-- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Assets/Scripts/umamusume/Gallop/Live/Director.cs b/Assets/Scripts/umamusume/Gallop/Live/Director.cs index b250a1d..4a2dca8 100644 --- a/Assets/Scripts/umamusume/Gallop/Live/Director.cs +++ b/Assets/Scripts/umamusume/Gallop/Live/Director.cs @@ -445,7 +445,7 @@ namespace Gallop.Live _uvScrollAccum[data.name] = Vector2.zero; _uvScrollAccum[data.name] += new Vector2(keyData.scrollSpeedX, keyData.scrollSpeedY) * Time.deltaTime; Vector2 totalOffset = new Vector2(keyData.scrollOffsetX, keyData.scrollOffsetY) + _uvScrollAccum[data.name]; - foreach (var r in _stageController.GetComponentsInChildren()) + foreach (var r in _stageController.GetComponentsInChildren(true)) { foreach (var mat in r.materials) { diff --git a/Assets/Scripts/umamusume/Gallop/Live/StageController.cs b/Assets/Scripts/umamusume/Gallop/Live/StageController.cs index 3dd6a05..46072de 100644 --- a/Assets/Scripts/umamusume/Gallop/Live/StageController.cs +++ b/Assets/Scripts/umamusume/Gallop/Live/StageController.cs @@ -42,6 +42,14 @@ namespace Gallop.Live } } + // Objects controlled by timeline handlers (BlinkLight / WashLight / Spotlight3d / Laser) + // start inactive; their handlers call SetActive(true) when the track fires. + private static bool IsTimelineControlledLight(string name) => + name.Contains("blinklight") || + name.Contains("spotlight3d") || + name.Contains("_wash_") || + name.Contains("laser"); + public void InitializeStage() { foreach (GameObject stage_part in _stageObjects) @@ -51,8 +59,8 @@ namespace Gallop.Live { if (!StageObjectMap.ContainsKey(child.name)) { - if (child.name.Contains("light")) - child.gameObject.SetActive(false); // hidden by default, handlers activate as needed + if (IsTimelineControlledLight(child.name)) + child.gameObject.SetActive(false); var tmp_name = child.name.Replace("(Clone)", ""); StageObjectMap.Add(tmp_name, child.gameObject); StageParentMap.TryAdd(tmp_name, child.gameObject.transform.parent); diff --git a/CLAUDE.md b/CLAUDE.md index e079e9c..c4bef89 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -56,7 +56,7 @@ StageController.cs ← manages stage GameObjects, StageObjectMap **Important:** `LiveTimelineKeyWithInterpolate` already declares `frame`, `attribute`, `interpolateType`, `curve`, `easingType` — do NOT redeclare these in subclasses. -**StageObjectMap:** Stage child GameObjects are indexed by name. Objects with "light" in their name start `SetActive(false)` but ARE registered — handlers call `SetActive(true)` as needed. +**StageObjectMap:** Stage child GameObjects are indexed by name. Objects whose names match `IsTimelineControlledLight()` (`blinklight`, `spotlight3d`, `_wash_`, `laser`) start `SetActive(false)` — their handlers call `SetActive(true)` when the track fires. All other objects (neonsigns, glow meshes, UV scroll objects, etc.) keep their prefab default state. ## Currently Implemented Tracks @@ -66,7 +66,8 @@ StageController.cs ← manages stage GameObjects, StageObjectMap | CharaMotionSequence | existing | | | Facial / LipSync / FormationOffset | existing | | | GlobalLight (48) | existing | sets rim light shader props on characters | -| BgColor1/2 | existing | sets toon shader color props | +| BgColor1 | existing | sets toon shader color props on characters (`_CharaColor`, `_ToonDarkColor`, etc.) | +| BgColor2 | existing | sets `_AmbientColor` on stage renderers via `Lerp(color1, color2, value)` | | Transform / Object | existing | handled by `StageController.cs` | | Effect (60) | `LiveTimelineEffectData` | loads prefab from `3d/effect/live/pfb_{name}` | | GlobalFog (49) | `LiveTimelineGlobalFogData` | sets `RenderSettings.fog*` | diff --git a/LIVE_DEV_MAP.md b/LIVE_DEV_MAP.md index d6ccfb6..cf67dc5 100644 --- a/LIVE_DEV_MAP.md +++ b/LIVE_DEV_MAP.md @@ -58,7 +58,7 @@ Toon shader 已移植,卡住的主要是全屏后处理和几个逆向未完 | 轨道 | 状态 | |------|------| | GlobalFog (49) | ✅ fogColor / fogMode / fogDensity / fogStart / fogEnd | -| BgColor2 (9) | ⚠️ 接线完成,`RenderSettings.ambient*` 打错目标(见卡点) | +| BgColor2 (9) | ✅ 写含 `_AmbientColor` 属性的舞台材质,`Lerp(color1, white, value)` | ### URP Volume / RendererFeature | 轨道 | 状态 | @@ -91,7 +91,6 @@ Toon shader 已移植,卡住的主要是全屏后处理和几个逆向未完 | 轨道 | 不明白什么 | |------|-----------| -| BgColor2 (9) | entry 名 `BgWashA`~`J` 在所有 bundle 里找不到;舞台 shader 不响应 `RenderSettings.ambient`(15/58 首)| | MonitorControl (10) | `dispID` 0–15 不对应 monitor 材质索引,内容资源路径未知;颜色/UV 控制可先做(★★/58 首)| | AdditionalLight (82) | 字段未 dump,结构未知(22/58 首)| @@ -127,7 +126,7 @@ Toon shader 已移植,卡住的主要是全屏后处理和几个逆向未完 | `Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineControl.cs` | 每帧插值 + 事件触发 | | `Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineWorkSheet.cs` | 所有轨道字段声明 | | `Assets/Scripts/umamusume/Gallop/Live/Cutt/LiveTimelineDataList/` | 各轨道数据类 | -| `Assets/Scripts/umamusume/Gallop/Live/StageController.cs` | StageObjectMap(按名字查舞台对象)| +| `Assets/Scripts/umamusume/Gallop/Live/StageController.cs` | StageObjectMap(按名字查舞台对象);`IsTimelineControlledLight()` 决定哪些对象默认 inactive(`blinklight`/`spotlight3d`/`_wash_`/`laser`)| | `Assets/Resources/RenderPipeline/UMAUniversalRenderPipelineAsset_Renderer.asset` | RendererFeature 注册位置 | | `LIVE_TRACKS.md` | 103 条轨道全览(ID/覆盖率/状态/Bug)| | `live-shader-todo.md` | 后处理轨道实现细节 | diff --git a/LIVE_TRACKS.md b/LIVE_TRACKS.md index e413b38..47ba37f 100644 --- a/LIVE_TRACKS.md +++ b/LIVE_TRACKS.md @@ -32,7 +32,7 @@ originSessionId: 319ae839-0292-4b1e-80de-2f3c91b1f40e | 6 | Event | 时间轴触发事件 | ❌ | — | | 7 | CharaMotionSequence ★(5) | 角色动作序列切换 | ✅ | — | | 8 | BgColor1 ★(13) | 角色色调/轮廓/阴影颜色 | ✅ | — | -| 9 | BgColor2 ★(1) | 背景渐变/环境色(两色混合)【15/58首】 | ⚠️ | 当前用RenderSettings.ambient*近似,但舞台shader不响应Unity实时光照,实际shader属性名待确认 | +| 9 | BgColor2 ★(1) | 背景渐变/环境色(两色混合)【15/58首】 | ✅ | 写含 `_AmbientColor` 属性的舞台材质,颜色 = `Lerp(color1, color2, value)`;color2 恒为白色 | | 10 | MonitorControl ★(2) | LED舞台屏幕内容控制 | ❌ | — | | 11 | CameraSwitcher | 切换活动摄像机 | ✅ | — | | 12 | LipSync | 口型同步 | ✅ | — | @@ -90,7 +90,7 @@ originSessionId: 319ae839-0292-4b1e-80de-2f3c91b1f40e | 43 | WashLight | 洗光灯 SetActive+颜色亮度 | ⚠️ | RaycastDistance/CameraProjectionSide/MulColor0未使用 | | 44 | Laser | 激光灯变换+SetActive | ⚠️ | blinkRate/blinkOffset/rotateFollowCamera/RaycastDistance未实现 | | 45 | BlinkLight ★(9) | 频闪灯亮灭周期/颜色/亮度 | ⚠️ | color1Array/LightBlendMode/isReverseHueArray未使用 | -| 46 | UVScrollLight ★(1) | 材质UV滚动灯光效果 | ⚠️ | scrollSpeedX/Y误用SetTextureScale(应每帧累积offset);mulColor1/ColorType/CharacterIndex等未使用 | +| 46 | UVScrollLight ★(1) | 材质UV滚动灯光效果 | ⚠️ | mulColor1/ColorType/CharacterIndex等未使用 | | 47 | FacialToon | 角色卡通着色参数 | ❌ | — | | 48 | GlobalLight ★(2) | 全局光方向/RimLight参数 | ✅ | — | | 49 | GlobalFog ★(1) | 全局雾效(颜色/密度/范围) | ✅ | — |