Docs: reduce over-documentation across gameplay scripts

Trim restated narration, dead commented-out code, and oversized class
headers; keep all why-comments (authority, timing, edge cases), tooltips,
and serialization caveats.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Fable 5 committed 2026-07-02 10:08:28 +02:00
1 parent 882d30797e
commit 066e308cde
21 files changed
+478 -902

No files matched your search

+13 -26
View File
@@ -2,34 +2,21 @@ using UnityEngine;
using Unity.Cinemachine;
/// <summary>
/// Drives the world-space "hero cutout": occluder geometry that sits inside a cone running from the
/// third-person camera (apex) to the player is clipped away, punching a clean see-through funnel toward
/// the character. Every late frame this feeds two global shader properties (<c>_HeroCutoutTarget</c>,
/// <c>_HeroCutoutParams</c>) that the <c>Custom/HeroCutoutLit</c> shader reads.
/// Drives the world-space "hero cutout": occluder geometry inside a cone from the third-person camera
/// (apex) to the player is clipped away, punching a see-through funnel toward the character. Each late
/// frame this feeds two global shader properties (<c>_HeroCutoutTarget</c>, <c>_HeroCutoutParams</c>)
/// that <c>Custom/HeroCutoutLit</c> reads.
///
/// Arming is deliberately simple: a single ray is cast FROM the camera TOWARD the player. If it hits
/// world geometry before reaching the player, the cut is armed; with a clear line of sight the
/// occluders stay solid. There is no multi-sample / silhouette estimation - one ray, one answer.
/// Arming is deliberately simple: ONE ray from the camera toward the player - blocked = armed, clear
/// view = occluders stay solid. The cut volume lives entirely in the shader: everything between camera
/// and player (within the cone) is cut, geometry behind the player stays solid, and the far end fades
/// across a soft depth band (<see cref="depthFeather"/>) instead of a hard plane. The cone radius grows
/// with camera distance, so the hole keeps a constant on-screen size at every occluder depth.
///
/// The cut volume is defined entirely in the shader as a cone along the camera->player axis: everything
/// BETWEEN camera and player (within the cone) is cut; geometry well behind the player stays solid - so a
/// wall the player stands in front of renders completely normally. The far end fades out across a soft
/// depth band (<see cref="depthFeather"/>) straddling the player rather than snapping off at a hard
/// plane, so an occluder running past the player fades just behind them with no hard cut line. The cone's
/// radius grows with distance from the camera, so the hole keeps a constant on-screen size regardless of
/// occluder depth.
///
/// The effect is only active while the third-person orbit <see cref="CinemachineCamera"/> is the live
/// Cinemachine camera (Player Control / Paint mode). In first-person, free-cam or while a menu is open
/// a different vcam is live and the cutout disarms. Disarming clears the global "enabled" flag (also
/// the zero-initialised default), so any scene without this driver - or any frame with a clear view -
/// leaves cutout materials looking exactly like URP/Lit.
///
/// This replaces the camera pulling in toward the player (Cinemachine Deoccluder): instead of closing
/// the distance to dodge an obstacle, the camera holds its orbit distance and the obstacle is punched
/// see-through.
///
/// Attach to a persistent scene object (e.g. the GameModeManager host).
/// Active only while the third-person orbit vcam is the live Cinemachine camera; disarming clears the
/// global flag (also the zero-initialised default), so scenes without this driver render cutout
/// materials as plain URP/Lit. Replaces the Cinemachine Deoccluder pull-in: the camera holds its orbit
/// distance and the obstacle goes see-through. Attach to a persistent scene object.
/// </summary>
[DisallowMultipleComponent]
public class HeroCutout : MonoBehaviour