Refactor: extract shared helpers across scripts, trim remaining doc redundancy

Deduplication pass (44 extractions):
- New SmoothedLook: shared smoothed yaw/pitch look tick + view seeding
  (FirstPersonController, FreeCamController)
- New CharacterTeleport: disable-CC-around-teleport idiom (rescue,
  owner position apply, free-cam sync)
- New GeometryUtil: RescaleToUnitScale + TransformBounds (concealment
  meter/volume, skinned collider baker)
- Paint family: canonical map read/write shared between Net and
  Persistence, snapshot decode, backend stroke dispatch, RebuildBackend,
  ResolveSeed, chunked RPC send/gate/copy, CamoKnobs/HeightKnobs
  aggregates, SanitizeFileKey, NewMaskTexture, AdoptAlbedo, FindSlider
- Player/modes: GameMode SetPlayerControl/SetPainting/SetOrbitInputEnabled,
  InputUtil.GameplayKeyPressed, NearestClimbHit, ComputeXRay delegates to
  ComputeResolutionFreeze, FingerIK TryInPlaneAngle
- Match/misc: UnhookSessionCallbacks, SendEmptyNamedMessage, SwapScenes,
  RunSessionOpAsync, CovarianceEigen, CollectClusterPoints, MatchHud
  GUIStyle cache, HsvColorPicker rehook, VoxelCenter

Documentation pass: remove 6 triplicated doc blocks and 2 restating
inline comments left after the previous reduction.

Behavior-neutral; hot-path rasterizer loops intentionally untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Fable 5 committed 2026-07-02 12:33:48 +02:00
1 parent 066e308cde
commit 2243cc823e
40 files changed
+681 -724

No files matched your search

+12 -10
View File
@@ -110,11 +110,7 @@ public class HsvColorPicker : MonoBehaviour
_svHandle = sv.Find("Handle") as RectTransform;
if (sv.TryGetComponent(out UiPointerSurface svPointer))
{
svPointer.Picked -= OnSvPicked;
svPointer.Picked += OnSvPicked;
}
Rehook(sv, OnSvPicked);
}
var hue = transform.Find("Hue") as RectTransform;
@@ -123,11 +119,7 @@ public class HsvColorPicker : MonoBehaviour
if (hue.TryGetComponent(out Image hueImg)) hueImg.sprite = PaintHud.HueSprite();
_hueHandle = hue.Find("Handle") as RectTransform;
if (hue.TryGetComponent(out UiPointerSurface huePointer))
{
huePointer.Picked -= OnHuePicked;
huePointer.Picked += OnHuePicked;
}
Rehook(hue, OnHuePicked);
}
// Alpha now lives on a standalone slider (PaintHud), not in the picker. Hide any alpha bar a
@@ -141,6 +133,16 @@ public class HsvColorPicker : MonoBehaviour
Refresh();
}
// Idempotently hooks the handler to the surface's drag relay (unsubscribe-then-subscribe).
private static void Rehook(Component surface, Action<Vector2> handler)
{
if (surface.TryGetComponent(out UiPointerSurface pointer))
{
pointer.Picked -= handler;
pointer.Picked += handler;
}
}
private void OnSvPicked(Vector2 p)
{
_s = p.x;