Search Results for

    Show / Hide Table of Contents

    Class KaijuAgentsWithin

    Extension methods to see if points are within a given distance of each other along the X and Z axes. These methods are inclusive of the distance to check. All three-dimensional vectors will be flattened via methods in KaijuAgentsFlatten.

    Inheritance
    System.Object
    KaijuAgentsWithin
    Namespace: KaijuSolutions.Agents.Extensions
    Syntax
    public static class KaijuAgentsWithin

    Methods

    Within(Component, Component, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Component self, Component other, float distance)
    Parameters
    Type Name Description
    Component self

    This position.

    Component other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Component, GameObject, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Component self, GameObject other, float distance)
    Parameters
    Type Name Description
    Component self

    This position.

    GameObject other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Component, Transform, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Component self, Transform other, float distance)
    Parameters
    Type Name Description
    Component self

    This position.

    Transform other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Component, Vector2, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Component self, Vector2 other, float distance)
    Parameters
    Type Name Description
    Component self

    This position.

    Vector2 other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Component, Vector3, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Component self, Vector3 other, float distance)
    Parameters
    Type Name Description
    Component self

    This position.

    Vector3 other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(GameObject, Component, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this GameObject self, Component other, float distance)
    Parameters
    Type Name Description
    GameObject self

    This position.

    Component other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(GameObject, GameObject, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this GameObject self, GameObject other, float distance)
    Parameters
    Type Name Description
    GameObject self

    This position.

    GameObject other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(GameObject, Transform, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this GameObject self, Transform other, float distance)
    Parameters
    Type Name Description
    GameObject self

    This position.

    Transform other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(GameObject, Vector2, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this GameObject self, Vector2 other, float distance)
    Parameters
    Type Name Description
    GameObject self

    This position.

    Vector2 other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(GameObject, Vector3, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this GameObject self, Vector3 other, float distance)
    Parameters
    Type Name Description
    GameObject self

    This position.

    Vector3 other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Transform, Component, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Transform self, Component other, float distance)
    Parameters
    Type Name Description
    Transform self

    This position.

    Component other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Transform, GameObject, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Transform self, GameObject other, float distance)
    Parameters
    Type Name Description
    Transform self

    This position.

    GameObject other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Transform, Transform, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Transform self, Transform other, float distance)
    Parameters
    Type Name Description
    Transform self

    This position.

    Transform other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Transform, Vector2, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Transform self, Vector2 other, float distance)
    Parameters
    Type Name Description
    Transform self

    This position.

    Vector2 other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Transform, Vector3, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Transform self, Vector3 other, float distance)
    Parameters
    Type Name Description
    Transform self

    This position.

    Vector3 other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Vector2, Component, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Vector2 self, Component other, float distance)
    Parameters
    Type Name Description
    Vector2 self

    This position.

    Component other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Vector2, GameObject, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Vector2 self, GameObject other, float distance)
    Parameters
    Type Name Description
    Vector2 self

    This position.

    GameObject other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Vector2, Transform, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Vector2 self, Transform other, float distance)
    Parameters
    Type Name Description
    Vector2 self

    This position.

    Transform other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Vector2, Vector2, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Vector2 self, Vector2 other, float distance)
    Parameters
    Type Name Description
    Vector2 self

    This position.

    Vector2 other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Vector2, Vector3, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Vector2 self, Vector3 other, float distance)
    Parameters
    Type Name Description
    Vector2 self

    This position.

    Vector3 other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Vector3, Component, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Vector3 self, Component other, float distance)
    Parameters
    Type Name Description
    Vector3 self

    This position.

    Component other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Vector3, GameObject, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Vector3 self, GameObject other, float distance)
    Parameters
    Type Name Description
    Vector3 self

    This position.

    GameObject other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Vector3, Transform, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Vector3 self, Transform other, float distance)
    Parameters
    Type Name Description
    Vector3 self

    This position.

    Transform other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Vector3, Vector2, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Vector3 self, Vector2 other, float distance)
    Parameters
    Type Name Description
    Vector3 self

    This position.

    Vector2 other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    Within(Vector3, Vector3, Single)

    If this is within a distance to another position.

    Declaration
    public static bool Within(this Vector3 self, Vector3 other, float distance)
    Parameters
    Type Name Description
    Vector3 self

    This position.

    Vector3 other

    The other position.

    System.Single distance

    The distance.

    Returns
    Type Description
    System.Boolean

    If this is within a distance to another position.

    In This Article
    Back to top MIT License © 2026 Kaiju Solutions Inc.