Refactor scripts: dedup remainder, remove dead code, perf hardening

Iteration 4 over Assets/Scripts (no component/file splits, no Unity assets touched):

Dedup:
- Route inline cursor-release, material guards, Ctrl-held and undo/redo
  input through existing InputUtil / SetMatFloat helpers
- Add ungated InputUtil.KeyPressedThisFrame; GameplayKeyPressed builds on it
- Unify FindDeep/FindDeepChild into GeometryUtil.FindDeep

Dead code / stale docs:
- Remove unused code-gen bake path (HsvColorPicker.Build, PaintHud factory)
- Drop unreferenced symbols (SubPhaseChanged event, LocalPhaseDuration,
  IsLocalSceneMain, MouseSensitivity.Changed, IsPaused, InSession,
  NetworkControlled, PreviousPose, JointCount, voxel-count accessors)
- Fix incorrect PlayerRole / PaintHud / Pick / PlayerPose docs

Perf / robustness (behaviour-neutral):
- ConcealmentMeter.Evaluate: reuse vertex/topology buffers, two-pointer
  crossing count
- BuildMeshCaches: alloc-free vertex copy, cached topology/UVs
- Guard all PlayerPaintSync LogSync sites behind logSync
- Cache LocalViewerIsHunter / controller / CanShoot / TypingGuard lookups;
  dedup LocalIsHunter with MatchHud
- Change-guard RefreshEmissionColor and HeroCutout.Disarm
- Cache scene/countdown string comparisons per frame
- Grow NonAlloc buffers and log-once on saturation

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 4.8 committed 2026-07-02 13:33:18 +02:00
1 parent 2243cc823e
commit 382bfb36df
32 files changed
+292 -348

No files matched your search

+4 -4
View File
@@ -125,7 +125,7 @@ public partial class PaintHud
foreach (var name in DraggablePanels)
{
if (FindDeep(panel, name) is RectTransform rt)
if (GeometryUtil.FindDeep(panel, name) is RectTransform rt)
state.panels.Add(new PanelPos { name = name, pos = rt.anchoredPosition });
}
@@ -201,7 +201,7 @@ public partial class PaintHud
var root = _panel.transform;
if (state.panels != null)
foreach (var p in state.panels)
if (FindDeep(root, p.name) is RectTransform rt)
if (GeometryUtil.FindDeep(root, p.name) is RectTransform rt)
rt.anchoredPosition = p.pos;
}
@@ -441,7 +441,7 @@ public partial class PaintHud
if (_hasAuthoredLayout || !_panel) return;
var root = _panel.transform;
foreach (var name in DraggablePanels)
if (FindDeep(root, name) is RectTransform rt)
if (GeometryUtil.FindDeep(root, name) is RectTransform rt)
_authoredPanelPos[name] = rt.anchoredPosition;
_hasAuthoredLayout = true;
}
@@ -483,7 +483,7 @@ public partial class PaintHud
{
var root = _panel.transform;
foreach (var kv in _authoredPanelPos)
if (FindDeep(root, kv.Key) is RectTransform rt)
if (GeometryUtil.FindDeep(root, kv.Key) is RectTransform rt)
rt.anchoredPosition = kv.Value;
}