Skip to content

RendererExtensions

Namespace: SideXP.Core

public static class RendererExtensions

Extension functions for Renderer components.

Methods

GetRendererBounds(Renderer)

public static Bounds GetRendererBounds(Renderer renderer)

Gets the bounds of a renderer.

Parameters

  • renderer: The renderer of which to query the bounds.

Returns

Returns the renderer bounds.

Remarks

Contrary to colliders (see GetColliderBounds), a mesh renderer's bounds is populated even when the game is not running, so it can be read directly here.

GetRendererBounds(Renderer, Bounds)

public static bool GetRendererBounds(Renderer renderer, out Bounds bounds)

Gets the bounds of a renderer.

Parameters

  • renderer: The renderer of which to query the bounds.
  • bounds: Outputs the renderer bounds.

Returns

Always returns true (every Renderer exposes bounds).

Remarks

Contrary to colliders (see GetColliderBounds), a mesh renderer's bounds is populated even when the game is not running, so it can be read directly here.