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
@@ -8,16 +8,10 @@ using UnityEngine.InputSystem;
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Holds a list of <see cref="PlayerPose"/>s plus the active index. The pose system owns ALL character
|
||||
/// animation (the Animator is left empty): standing / airborne / wall / ceiling holds the active pose's
|
||||
/// idle clip, walking/sprinting on the ground plays its optional walk/run clip (unset = idle held).
|
||||
///
|
||||
/// One key cycles poses (wrapping); sprinting in any state snaps back to the default pose, held
|
||||
/// continuously so the reset shows up immediately. Clips play through a tiny <see cref="PlayableGraph"/>
|
||||
/// (two-input mixer on an <see cref="AnimationPlayableOutput"/>) that crossfades every clip switch over
|
||||
/// <see cref="poseBlendDuration"/>. Each pose also carries its own CharacterController capsule (eased,
|
||||
/// so a low pose can crawl under furniture) and per-pose camera y-offsets (third-person framing and
|
||||
/// first-person eye).
|
||||
/// Owns ALL character animation (the Animator is left empty): plays the active <see cref="PlayerPose"/>'s
|
||||
/// idle or optional walk/run/fall clip through a two-input mixer <see cref="PlayableGraph"/> that
|
||||
/// crossfades every clip switch. One key cycles poses, sprinting resets to the default pose; each pose
|
||||
/// also carries its own eased CharacterController capsule and per-pose camera y-offsets.
|
||||
/// </summary>
|
||||
[RequireComponent(typeof(PlayerCharacterController))]
|
||||
[DisallowMultipleComponent]
|
||||
@@ -115,10 +109,9 @@ public class PlayerPoseController : MonoBehaviour
|
||||
private Quaternion[] _restRot;
|
||||
private Vector3[] _restScale;
|
||||
|
||||
/// <summary>Index of the currently selected pose.</summary>
|
||||
public int CurrentIndex => _currentIndex;
|
||||
|
||||
/// <summary>Locomotion category resolved this frame (which clip the active pose is playing). The owner publishes it for network sync.</summary>
|
||||
/// <summary>Locomotion category resolved this frame; the owner publishes it for network sync.</summary>
|
||||
public Locomotion CurrentLocomotion => _currentLocomotion;
|
||||
|
||||
/// <summary>
|
||||
@@ -219,7 +212,6 @@ public class PlayerPoseController : MonoBehaviour
|
||||
_firstPersonCameraOffset = EaseCameraOffset(_firstPersonCameraOffset, firstPersonTarget);
|
||||
}
|
||||
|
||||
/// <summary>Eases a camera y-offset toward its target at <see cref="cameraOffsetSpeed"/>; 0 snaps.</summary>
|
||||
private float EaseCameraOffset(float current, float target)
|
||||
{
|
||||
return cameraOffsetSpeed > 0f
|
||||
@@ -261,7 +253,6 @@ public class PlayerPoseController : MonoBehaviour
|
||||
return poses[Mathf.Clamp(_currentIndex, 0, poses.Count - 1)];
|
||||
}
|
||||
|
||||
/// <summary>Maps the controller's current movement state to a locomotion category for clip selection.</summary>
|
||||
private Locomotion ResolveLocalLocomotion()
|
||||
{
|
||||
if (_player.IsMovingOnGround)
|
||||
@@ -375,7 +366,6 @@ public class PlayerPoseController : MonoBehaviour
|
||||
_posePlaying = true;
|
||||
}
|
||||
|
||||
/// <summary>Builds the graph (a 2-input mixer feeding the Animator output) lazily if it isn't alive yet.</summary>
|
||||
private void EnsureGraph()
|
||||
{
|
||||
if (_graph.IsValid())
|
||||
@@ -426,7 +416,6 @@ public class PlayerPoseController : MonoBehaviour
|
||||
ApplyBlendWeights();
|
||||
}
|
||||
|
||||
/// <summary>Advances an in-flight crossfade and drops the outgoing pose once it has fully faded.</summary>
|
||||
private void AdvanceBlend(float dt)
|
||||
{
|
||||
if (!_blending)
|
||||
@@ -446,7 +435,6 @@ public class PlayerPoseController : MonoBehaviour
|
||||
ApplyBlendWeights();
|
||||
}
|
||||
|
||||
/// <summary>Pushes the current blend onto the mixer inputs (smoothstepped while a "from" pose exists).</summary>
|
||||
private void ApplyBlendWeights()
|
||||
{
|
||||
if (!_mixer.IsValid())
|
||||
|
||||
Reference in new issue
Block a user