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 -26
View File
@@ -5,7 +5,7 @@ using UnityEngine;
/// plus optional walk and run clips that the pose system plays itself (the Animator stays empty) while
/// moving on the ground, its own CharacterController capsule dimensions (so a low pose like a ball can
/// crawl under furniture the default standing capsule is too tall for), and a camera-target y-offset that
/// frames the pose without moving the body. The first ScriptableObject in this project.
/// frames the pose without moving the body.
///
/// Named PlayerPose (not Pose) to avoid shadowing the built-in UnityEngine.Pose struct, mirroring
/// why the controller is PlayerCharacterController and not just "PlayerController".
@@ -72,42 +72,18 @@ public class PlayerPose : ScriptableObject
"sensible height even though the camera target sits where third-person frames it. Meters.")]
[SerializeField] private float firstPersonCameraTargetYOffset;
/// <summary>Idle clip held while the player stands still in this pose (may be null).</summary>
// Read-only accessors; semantics are documented on the serialized fields' tooltips above.
public AnimationClip Clip => clip;
/// <summary>Playback speed multiplier for the idle clip (1 = authored speed).</summary>
public float ClipSpeed => clipSpeed;
/// <summary>Optional clip played while walking on the ground; null = hold the idle pose.</summary>
public AnimationClip WalkClip => walkClip;
/// <summary>Playback speed multiplier for the walk clip (1 = authored speed).</summary>
public float WalkClipSpeed => walkClipSpeed;
/// <summary>Optional clip played while sprinting on the ground; null = hold the idle pose.</summary>
public AnimationClip RunClip => runClip;
/// <summary>Playback speed multiplier for the run clip (1 = authored speed).</summary>
public float RunClipSpeed => runClipSpeed;
/// <summary>Optional clip played while falling; null = hold the idle pose.</summary>
public AnimationClip FallClip => fallClip;
/// <summary>Playback speed multiplier for the fall clip (1 = authored speed).</summary>
public float FallClipSpeed => fallClipSpeed;
/// <summary>CharacterController capsule center Y applied while this pose is active.</summary>
public float ControllerCenterY => controllerCenterY;
/// <summary>CharacterController capsule radius applied while this pose is active.</summary>
public float ControllerRadius => controllerRadius;
/// <summary>CharacterController capsule height applied while this pose is active.</summary>
public float ControllerHeight => controllerHeight;
/// <summary>Local-up offset applied to the camera target while this pose is active (any state).</summary>
public float CameraTargetYOffset => cameraTargetYOffset;
/// <summary>Additional local-up offset for the first-person eye, on top of the camera target (first person only).</summary>
public float FirstPersonCameraTargetYOffset => firstPersonCameraTargetYOffset;
}