Super Bomber Kit
Search Results for

    Show / Hide Table of Contents

    Class VectorExtensions

    Inheritance
    object
    VectorExtensions
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: BomberDogs.Extensions
    Assembly: Assembly-CSharp.dll
    Syntax
    public static class VectorExtensions

    Methods

    | Edit this page View Source

    ChangeZ(Vector3, float)

    Change only z value

    Declaration
    public static Vector3 ChangeZ(this Vector3 vector, float value)
    Parameters
    Type Name Description
    Vector3 vector
    float value
    Returns
    Type Description
    Vector3
    | Edit this page View Source

    ClampAxisTo8Directions(Vector2)

    Limits a direction to only 8 directions.

    Declaration
    public static Vector2 ClampAxisTo8Directions(this Vector2 direction)
    Parameters
    Type Name Description
    Vector2 direction

    direction

    Returns
    Type Description
    Vector2

    clamped direction

    | Edit this page View Source

    Snap(Vector2)

    Centers to the middle of each 1-meter square in the scene space. For example, 0.01 becomes 0.5, 0.99 becomes 0.5, 1.01 becomes 1.5, and so on.

    Declaration
    public static Vector2 Snap(this Vector2 vector)
    Parameters
    Type Name Description
    Vector2 vector

    original vector

    Returns
    Type Description
    Vector2

    snapped position

    | Edit this page View Source

    Snap(Vector3)

    Centers to the middle of each 1-meter square in the scene space. For example, 0.01 becomes 0.5, 0.99 becomes 0.5, 1.01 becomes 1.5, and so on.

    Declaration
    public static Vector3 Snap(this Vector3 vector)
    Parameters
    Type Name Description
    Vector3 vector

    original vector

    Returns
    Type Description
    Vector3

    snapped position

    | Edit this page View Source

    clampAxisTo4Directions(Vector2)

    Limits a direction to only 4 directions.

    Declaration
    public static Vector2 clampAxisTo4Directions(this Vector2 direction)
    Parameters
    Type Name Description
    Vector2 direction
    Returns
    Type Description
    Vector2
    • Edit this page
    • View Source
    In this article
    Back to top