Trim comments and use implicit null checks for Unity objects
Reduce comments to non-obvious "why" notes and convert UnityEngine.Object null checks to implicit bool (if (obj) / if (!obj)). Input System devices (Mouse.current, Keyboard.current) and plain arrays keep explicit != null. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
3da613e1a1
commit
f758c96dc5
8 files changed
+220
-427
No files matched your search
@@ -1,7 +1,6 @@
|
||||
/// <summary>
|
||||
/// Mode 2: the player stands still and the mesh is painted with the left mouse
|
||||
/// button. The camera orbits only while the right mouse button is held, so
|
||||
/// dragging with the left button paints instead of rotating the view.
|
||||
/// Player stands still, the mesh is painted with the left mouse button. The
|
||||
/// camera orbits only while the right mouse button is held.
|
||||
/// </summary>
|
||||
public class PaintMode : GameMode
|
||||
{
|
||||
@@ -9,13 +8,13 @@ public class PaintMode : GameMode
|
||||
|
||||
public override void Enter()
|
||||
{
|
||||
if (Manager.Player != null)
|
||||
if (Manager.Player)
|
||||
Manager.Player.ControlEnabled = false;
|
||||
|
||||
if (Manager.CameraInput != null)
|
||||
if (Manager.CameraInput)
|
||||
Manager.CameraInput.LookMode = ThirdPersonOrbitInput.OrbitLookMode.HoldRightMouseButton;
|
||||
|
||||
if (Manager.Painter != null)
|
||||
if (Manager.Painter)
|
||||
Manager.Painter.PaintingEnabled = true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user