Table of Contents

Class AttachedSphereProximity

Namespace
Uncreated.Warfare.Proximity
Assembly
Uncreated.Warfare.dll

A sphere attached to a transform. Scale and position are applied.

public class AttachedSphereProximity : IAttachedSphereProximity, ISphereProximity, INearestPointProximity, IAttachableProximity<IAttachedSphereProximity>, IAttachedProximity, IProximity, IShapeVolume, ICloneable, IFormattable
Inheritance
AttachedSphereProximity
Implements
IShapeVolume
Inherited Members
Extension Methods

Constructors

AttachedSphereProximity(Transform, ISphereProximity)

Create a sphere from another ISphereProximity attached to attachmentRoot.

public AttachedSphereProximity(Transform attachmentRoot, ISphereProximity sphere)

Parameters

attachmentRoot Transform
sphere ISphereProximity

AttachedSphereProximity(Transform, in BoundingSphere)

Create a sphere from a UnityEngine.BoundingSphere.

public AttachedSphereProximity(Transform attachmentRoot, in BoundingSphere sphere)

Parameters

attachmentRoot Transform
sphere BoundingSphere

Exceptions

ArgumentException

Position or radius isn't finite (not NaN or Infinity).

AttachedSphereProximity(Transform, in Vector3, float)

Create a sphere from a position and radius.

public AttachedSphereProximity(Transform attachmentRoot, in Vector3 position, float radius)

Parameters

attachmentRoot Transform
position Vector3
radius float

Exceptions

ArgumentException

Position or radius isn't finite (not NaN or Infinity).

Properties

AttachmentRoot

The transform this proximity is attached to.

public Transform? AttachmentRoot { get; }

Property Value

Transform

Sphere

Sphere used for detection.

public BoundingSphere Sphere { get; }

Property Value

BoundingSphere

worldBounds

Not necessarily cheap to calculate - probably best to cache.

public Bounds worldBounds { get; }

Property Value

Bounds

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

position Vector2

Returns

bool

TestPoint(in Vector3)

Check if a position is within the proximity.

public bool TestPoint(in Vector3 position)

Parameters

position Vector3

Returns

bool

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

format string

The format to use.
-or-
A null reference (Nothing in Visual Basic) to use the default format defined for the type of the IFormattable implementation.

formatProvider IFormatProvider

The provider to use to format the value.
-or-
A null reference (Nothing in 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.