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:
1 parent
066e308cde
commit
2243cc823e
40 files changed
+681
-724
No files matched your search
@@ -14,18 +14,9 @@ public class FirstPersonMode : GameMode
|
||||
public override void Enter()
|
||||
{
|
||||
// Player stays fully controllable; only the view changes.
|
||||
if (Manager.Player)
|
||||
{
|
||||
Manager.Player.enabled = true;
|
||||
Manager.Player.ControlEnabled = true;
|
||||
}
|
||||
|
||||
if (Manager.Painter)
|
||||
Manager.Painter.PaintingEnabled = false;
|
||||
|
||||
// The orbit rig would otherwise keep grabbing the cursor and reading the mouse every frame.
|
||||
if (Manager.CameraInput)
|
||||
Manager.CameraInput.enabled = false;
|
||||
SetPlayerControl(true);
|
||||
SetPainting(false);
|
||||
SetOrbitInputEnabled(false);
|
||||
|
||||
if (Manager.FirstPerson)
|
||||
Manager.FirstPerson.SetActive(true);
|
||||
@@ -38,9 +29,9 @@ public class FirstPersonMode : GameMode
|
||||
if (Manager.FirstPerson)
|
||||
Manager.FirstPerson.SetActive(false);
|
||||
|
||||
SetOrbitInputEnabled(true);
|
||||
if (Manager.CameraInput)
|
||||
{
|
||||
Manager.CameraInput.enabled = true;
|
||||
// Carry the first-person facing into the orbit camera so the next orbit mode (Paint / Player
|
||||
// Control) keeps the current view angle instead of snapping back to the orbit's last-used angle.
|
||||
// Camera.main still shows the first-person view this frame (the brain hasn't blended yet).
|
||||
@@ -94,7 +85,7 @@ public class FirstPersonMode : GameMode
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var netObj = _hits[i].collider.GetComponentInParent<NetworkObject>();
|
||||
if (netObj && self && netObj == self) continue; // ignore our own collider
|
||||
if (netObj && self && netObj == self) continue;
|
||||
if (!netObj || !netObj.IsPlayerObject) return; // first solid hit is world geometry -> blocked
|
||||
|
||||
var setup = netObj.GetComponent<NetworkPlayerSetup>();
|
||||
|
||||
Reference in new issue
Block a user