Class AttachedAACylinderProximity
An axis-aligned cylinder attached to a transform. Scale, position, and rotation are applied.
public class AttachedAACylinderProximity : IAttachedAACylinderProximity, IAACylinderProximity, INearestPointProximity, IAttachableProximity<IAttachedAACylinderProximity>, IAttachedProximity, IProximity, IShapeVolume, ICloneable, IFormattable
- Inheritance
-
AttachedAACylinderProximity
- Implements
-
IShapeVolume
- Inherited Members
- Extension Methods
Constructors
AttachedAACylinderProximity(Transform, IAACylinderProximity)
Create an axis-aligned cylinder from another IAACylinderProximity attached to attachmentRoot.
public AttachedAACylinderProximity(Transform attachmentRoot, IAACylinderProximity cylinder)
Parameters
attachmentRootTransformcylinderIAACylinderProximity
AttachedAACylinderProximity(Transform, in Vector2, float, float)
Create an axis-aligned cylinder on the Y axis attached to attachmentRoot.
public AttachedAACylinderProximity(Transform attachmentRoot, in Vector2 center, float radius, float height = Infinity)
Parameters
attachmentRootTransformcenterVector2Center of the cylinder as (X, Z). Components must be finite.
radiusfloatRadius of the cylinder. Must be finite.
heightfloatHeight of the cylinder. Can be infinity or NaN (converts to infinity).
Exceptions
- ArgumentOutOfRangeException
Axis is not X, Y, or Z.
- ArgumentException
Radius or center is not finite.
AttachedAACylinderProximity(Transform, in Vector3, float, float, SnapAxis)
Create an axis-aligned cylinder attached to attachmentRoot.
public AttachedAACylinderProximity(Transform attachmentRoot, in Vector3 center, float radius, float height, SnapAxis axis = SnapAxis.Y)
Parameters
attachmentRootTransformcenterVector3Center of the cylinder. Depending on the axis one component will be discarded if
heightisn't finite. Other components must be finite.radiusfloatRadius of the cylinder. Must be finite.
heightfloatHeight of the cylinder. Can be infinity or NaN (converts to infinity).
axisSnapAxisAxis to align to. Defaults to the Y axis. Must either be UnityEngine.SnapAxis.X, UnityEngine.SnapAxis.Y, or UnityEngine.SnapAxis.Z.
Exceptions
- ArgumentOutOfRangeException
Axis is not X, Y, or Z.
- ArgumentException
Radius or center is not finite.
Properties
AttachmentRoot
The transform this proximity is attached to.
public Transform? AttachmentRoot { get; }
Property Value
- Transform
Axis
The axis the cylinder is aligned to. Must be 'X', 'Y', or 'Z'.
public SnapAxis Axis { get; }
Property Value
- SnapAxis
Remarks
Defaults to 'Y'.
Center
Center position of the cylinder.
public Vector3 Center { get; }
Property Value
- Vector3
Height
Cylinder height.
public float Height { get; }
Property Value
Remarks
Can be PositiveInfinity.
Radius
Radius of the cylinder.
public float Radius { get; }
Property Value
worldBounds
Axis-aligned bounds of the rectange.
public Bounds worldBounds { get; }
Property Value
- Bounds
Remarks
Equal to Dimensions in this case.
Methods
Clone()
Creates a new object that is a copy of the current instance.
public object Clone()
Returns
- object
A new object that is a copy of this instance.
TestPoint(in Vector2)
Check if a position is within the proximity while ignoring Y position.
public bool TestPoint(in Vector2 position)
Parameters
positionVector2
Returns
TestPoint(in Vector3)
Check if a position is within the proximity.
public bool TestPoint(in Vector3 position)
Parameters
positionVector3
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.
ToString(string, IFormatProvider)
Formats the value of the current instance using the specified format.
public string ToString(string format, IFormatProvider formatProvider)
Parameters
formatstringThe format to use.
-or-
A null reference (Nothingin Visual Basic) to use the default format defined for the type of the IFormattable implementation.formatProviderIFormatProviderThe provider to use to format the value.
-or-
A null reference (Nothingin Visual Basic) to obtain the numeric format information from the current locale setting of the operating system.
Returns
- string
The value of the current instance in the specified format.