Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


As<T>()

Return the specified geometric shape stored inside this Geometry Holder object.
Read time 1 minuteLast updated 10 days ago

Definition

public T As<T>() where T : struct, IGeometry

Returns

Type

Description

TReturns the basic geometric shape which is stored in the GeometryHolder.

Remarks

This function throws an InvalidOperationException if you try to request a geometric shape that is not stored in the GeometryHolder.
In the case of CapsuleGeometry, when Unity retrieves the shape from a CapsuleCollider component, the CapsuleCollider.direction is not included. For this reason, you should assume the direction is always along the X axis.