Class ColliderProximity
public class ColliderProximity : MonoBehaviour, ITrackingProximity<WarfarePlayer>, IEventBasedProximity<WarfarePlayer>, IDisposable, IFormattable, INearestPointProximity, IProximity, IShapeVolume, ICloneable
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourColliderProximity
- Implements
-
IShapeVolume
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutBehaviour.enabledBehaviour.isActiveAndEnabledComponent.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.transformComponent.gameObjectComponent.tagObject.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.nameObject.hideFlags
- Extension Methods
Constructors
ColliderProximity()
public ColliderProximity()
Properties
ActiveObjects
List of all objects currently in proximity.
public IReadOnlyList<WarfarePlayer> ActiveObjects { get; }
Property Value
Remarks
This should be updated before OnObjectEntered and OnObjectExited are updated.
Proximity
public IProximity Proximity { get; }
Property Value
Methods
Contains(WarfarePlayer)
If this object is in proximity.
public bool Contains(WarfarePlayer obj)
Parameters
objWarfarePlayer
Returns
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
fromLocationVector3
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
proximityIProximityplayerServiceIPlayerServiceleaveGameObjectAliveboolcolliderSettingsAction<Collider>validationCheckFunc<WarfarePlayer, bool>
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 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
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.
Events
OnObjectEntered
Invoked when an object goes in proximity.
public event Action<IEventBasedProximity<WarfarePlayer>, WarfarePlayer>? OnObjectEntered
Event Type
OnObjectExited
Invoked when an object leaves proximity.
public event Action<IEventBasedProximity<WarfarePlayer>, WarfarePlayer>? OnObjectExited