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<Renderer>(true)
so inactive renderers are included in material search.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
ritenseki
2026-05-07 20:19:45 +08:00
parent e76dd1c6f0
commit 7fc1511fd4
5 changed files with 18 additions and 10 deletions
@@ -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<Renderer>())
foreach (var r in _stageController.GetComponentsInChildren<Renderer>(true))
{
foreach (var mat in r.materials)
{
@@ -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);