Refactor Assets/Scripts: trim restating comments, minor structure cleanups
Sweep over 48 files (Editor/ excluded): remove comments that restate the code, condense class summaries, fix three stale doc statements (HsvColorPicker alpha bar, PaintHud layoutPrefab, MasterVolume FallbackDefault). Inline two single-use wrappers (IsPointerOverUi, BuildModes), drop an unused using, replace a magic literal with the existing ParallaxBase constant, and convert ~10 UnityEngine.Object null checks to the implicit-bool convention. No serialized fields, signatures, RPC/NetworkVariable names, defaults, or #if blocks touched. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
eeee5fc2f0
commit
6c03e5d3f6
48 files changed
+289
-481
No files matched your search
@@ -2,10 +2,9 @@ using UnityEngine;
|
||||
using Unity.Netcode;
|
||||
|
||||
/// <summary>
|
||||
/// First-person mode. The player keeps walking (WASD, camera-relative) but the camera moves to the
|
||||
/// player's eye (the CameraTarget) with free mouse-look, and the player's mesh is hidden so the body
|
||||
/// isn't seen from the inside. The orbit camera input is disabled while here so it doesn't fight for
|
||||
/// the cursor; the <see cref="FirstPersonController"/> drives its own dedicated CinemachineCamera.
|
||||
/// First-person mode. The player keeps walking, but the camera moves to the eye (CameraTarget) with
|
||||
/// free mouse-look and the player's mesh is hidden. Orbit camera input is disabled so it doesn't fight
|
||||
/// for the cursor; the <see cref="FirstPersonController"/> drives its own dedicated CinemachineCamera.
|
||||
/// </summary>
|
||||
public class FirstPersonMode : GameMode
|
||||
{
|
||||
@@ -13,7 +12,6 @@ public class FirstPersonMode : GameMode
|
||||
|
||||
public override void Enter()
|
||||
{
|
||||
// Player stays fully controllable; only the view changes.
|
||||
SetPlayerControl(true);
|
||||
SetPainting(false);
|
||||
SetOrbitInputEnabled(false);
|
||||
@@ -113,16 +111,16 @@ public class FirstPersonMode : GameMode
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
var netObj = _hits[i].collider.GetComponentInParent<NetworkObject>();
|
||||
if (netObj && self && netObj == self) continue; // skip own body
|
||||
if (netObj && self && netObj == self) continue;
|
||||
|
||||
end = _hits[i].point; // first non-self solid hit stops the beam here (wall or avatar)
|
||||
end = _hits[i].point;
|
||||
if (netObj && netObj.IsPlayerObject)
|
||||
{
|
||||
var setup = netObj.GetComponent<NetworkPlayerSetup>();
|
||||
if (setup && setup.Role == PlayerRole.Hider && !setup.IsFound)
|
||||
match.ReportHit(netObj.OwnerClientId);
|
||||
}
|
||||
break; // the first non-self hit decides the shot
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user