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

+2 -14
View File
@@ -180,7 +180,7 @@ public class HandIK : MonoBehaviour
var chain = new List<Transform>(8);
for (int f = 0; f < RootNames.Length; f++)
{
Transform root = FindDeepChild(handRoot, RootNames[f]);
Transform root = GeometryUtil.FindDeep(handRoot, RootNames[f]);
if (!root)
{
Debug.LogWarning($"HandIK: finger root '{RootNames[f]}' not found under {handRoot.name}.", this);
@@ -241,22 +241,10 @@ public class HandIK : MonoBehaviour
private Transform FindHandRoot()
{
Transform found = FindDeepChild(transform, "Hand");
Transform found = GeometryUtil.FindDeep(transform, "Hand");
return found ? found : transform;
}
private static Transform FindDeepChild(Transform parent, string targetName)
{
for (int i = 0; i < parent.childCount; i++)
{
Transform c = parent.GetChild(i);
if (c.name == targetName) return c;
Transform deep = FindDeepChild(c, targetName);
if (deep) return deep;
}
return null;
}
#if UNITY_EDITOR
private double _lastSig = double.NaN;