文档

Unity Engine

Unity Engine

As<T>()

Return the specified geometric shape stored inside this Geometry Holder object.
阅读时间1 分钟最后更新于 1 个月前

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.