Table of Contents

Class ColliderExtensions

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Extension methods for Unity Colliders, including gizmo drawing and dimension extraction.

public static class ColliderExtensions
Inheritance
ColliderExtensions
Inherited Members

Methods

DrawCenterMarker(Vector3, Color)

Draws a small solid cube at an object's transform center.

public static void DrawCenterMarker(Vector3 position, Color color)

Parameters

position Vector3

The center position to mark.

color Color

The base gizmo color.

DrawGizmo(Collider, Color)

Draws a gizmo for the collider in the editor using the specified color. Supports BoxCollider, SphereCollider, and CapsuleCollider.

public static void DrawGizmo(this Collider collider, Color color)

Parameters

collider Collider

The collider to draw.

color Color

The color to use for the gizmo.

TryGetDimensions(Collider, out float, out float)

Attempts to extract the height and radius from a collider. Supports SphereCollider, CapsuleCollider, BoxCollider, and MeshCollider.

public static bool TryGetDimensions(this Collider collider, out float height, out float radius)

Parameters

collider Collider

The collider to extract dimensions from.

height float

The extracted height value.

radius float

The extracted radius value.

Returns

bool

True if dimensions were successfully extracted; otherwise, false.