Table of Contents

Class ColliderProximity

Namespace
Uncreated.Warfare.Proximity
Assembly
Uncreated.Warfare.dll
public class ColliderProximity : MonoBehaviour, ITrackingProximity<WarfarePlayer>, IEventBasedProximity<WarfarePlayer>, IDisposable, IFormattable, INearestPointProximity, IProximity, IShapeVolume, ICloneable
Inheritance
Object
Component
Behaviour
MonoBehaviour
ColliderProximity
Implements
IShapeVolume
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.GetComponentIndex()
Component.transform
Component.gameObject
Component.tag
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, InstantiateParameters)
Object.InstantiateAsync<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.name
Object.hideFlags
Extension Methods

Constructors

ColliderProximity()

public ColliderProximity()

Properties

ActiveObjects

List of all objects currently in proximity.

public IReadOnlyList<WarfarePlayer> ActiveObjects { get; }

Property Value

IReadOnlyList<WarfarePlayer>

Remarks

This should be updated before OnObjectEntered and OnObjectExited are updated.

Proximity

public IProximity Proximity { get; }

Property Value

IProximity

Methods

Contains(WarfarePlayer)

If this object is in proximity.

public bool Contains(WarfarePlayer obj)

Parameters

obj WarfarePlayer

Returns

bool

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

GetNearestPointOnBorder(in Vector3)

Get the nearest point on the border of this proximity to fromLocation.

public Vector3 GetNearestPointOnBorder(in Vector3 fromLocation)

Parameters

fromLocation Vector3

Returns

Vector3

Initialize(IProximity, IPlayerService, bool, Action<Collider>?, Func<WarfarePlayer, bool>?)

public void Initialize(IProximity proximity, IPlayerService playerService, bool leaveGameObjectAlive, Action<Collider>? colliderSettings = null, Func<WarfarePlayer, bool>? validationCheck = null)

Parameters

proximity IProximity
playerService IPlayerService
leaveGameObjectAlive bool
colliderSettings Action<Collider>
validationCheck Func<WarfarePlayer, bool>

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 the name of the object.

public override string ToString()

Returns

string

The name returned by ToString.

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.

Events

OnObjectEntered

Invoked when an object goes in proximity.

public event Action<IEventBasedProximity<WarfarePlayer>, WarfarePlayer>? OnObjectEntered

Event Type

Action<IEventBasedProximity<WarfarePlayer>, WarfarePlayer>

OnObjectExited

Invoked when an object leaves proximity.

public event Action<IEventBasedProximity<WarfarePlayer>, WarfarePlayer>? OnObjectExited

Event Type

Action<IEventBasedProximity<WarfarePlayer>, WarfarePlayer>