Struct Vector2
Assembly: UnityEngine.dll
Syntax
public struct Vector2 : IEquatable<Vector2>
Constructors
|
Improve this Doc
View Source
Vector2(Single, Single)
Declaration
public Vector2(float x, float y)
Parameters
Fields
|
Improve this Doc
View Source
kEpsilon
Declaration
public const float kEpsilon = 1E-05F
Field Value
|
Improve this Doc
View Source
kEpsilonNormalSqrt
Declaration
public const float kEpsilonNormalSqrt = 1E-15F
Field Value
|
Improve this Doc
View Source
x
Declaration
Field Value
|
Improve this Doc
View Source
y
Declaration
Field Value
Properties
|
Improve this Doc
View Source
down
Declaration
public static Vector2 down { get; }
Property Value
|
Improve this Doc
View Source
Item[Int32]
Declaration
public float this[int index] { get; set; }
Parameters
Type |
Name |
Description |
Int32 |
index |
|
Property Value
|
Improve this Doc
View Source
left
Declaration
public static Vector2 left { get; }
Property Value
|
Improve this Doc
View Source
magnitude
Declaration
public float magnitude { get; }
Property Value
|
Improve this Doc
View Source
negativeInfinity
Declaration
public static Vector2 negativeInfinity { get; }
Property Value
|
Improve this Doc
View Source
normalized
Declaration
public Vector2 normalized { get; }
Property Value
|
Improve this Doc
View Source
one
Declaration
public static Vector2 one { get; }
Property Value
|
Improve this Doc
View Source
positiveInfinity
Declaration
public static Vector2 positiveInfinity { get; }
Property Value
|
Improve this Doc
View Source
right
Declaration
public static Vector2 right { get; }
Property Value
|
Improve this Doc
View Source
sqrMagnitude
Declaration
public float sqrMagnitude { get; }
Property Value
|
Improve this Doc
View Source
up
Declaration
public static Vector2 up { get; }
Property Value
|
Improve this Doc
View Source
zero
Declaration
public static Vector2 zero { get; }
Property Value
Methods
|
Improve this Doc
View Source
Angle(Vector2, Vector2)
Declaration
public static float Angle(Vector2 from, Vector2 to)
Parameters
Returns
|
Improve this Doc
View Source
ClampMagnitude(Vector2, Single)
Declaration
public static Vector2 ClampMagnitude(Vector2 vector, float maxLength)
Parameters
Returns
|
Improve this Doc
View Source
Distance(Vector2, Vector2)
Declaration
public static float Distance(Vector2 a, Vector2 b)
Parameters
Returns
|
Improve this Doc
View Source
Dot(Vector2, Vector2)
Declaration
public static float Dot(Vector2 lhs, Vector2 rhs)
Parameters
Returns
|
Improve this Doc
View Source
Equals(Object)
Declaration
public override bool Equals(object other)
Parameters
Type |
Name |
Description |
Object |
other |
|
Returns
Overrides
|
Improve this Doc
View Source
Equals(Vector2)
Declaration
public bool Equals(Vector2 other)
Parameters
Type |
Name |
Description |
Vector2 |
other |
|
Returns
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Overrides
|
Improve this Doc
View Source
Lerp(Vector2, Vector2, Single)
Declaration
public static Vector2 Lerp(Vector2 a, Vector2 b, float t)
Parameters
Returns
|
Improve this Doc
View Source
LerpUnclamped(Vector2, Vector2, Single)
Declaration
public static Vector2 LerpUnclamped(Vector2 a, Vector2 b, float t)
Parameters
Returns
|
Improve this Doc
View Source
Max(Vector2, Vector2)
Declaration
public static Vector2 Max(Vector2 lhs, Vector2 rhs)
Parameters
Returns
|
Improve this Doc
View Source
Min(Vector2, Vector2)
Declaration
public static Vector2 Min(Vector2 lhs, Vector2 rhs)
Parameters
Returns
|
Improve this Doc
View Source
MoveTowards(Vector2, Vector2, Single)
Declaration
public static Vector2 MoveTowards(Vector2 current, Vector2 target, float maxDistanceDelta)
Parameters
Returns
|
Improve this Doc
View Source
Normalize()
Declaration
|
Improve this Doc
View Source
Perpendicular(Vector2)
Declaration
public static Vector2 Perpendicular(Vector2 inDirection)
Parameters
Type |
Name |
Description |
Vector2 |
inDirection |
|
Returns
|
Improve this Doc
View Source
Reflect(Vector2, Vector2)
Declaration
public static Vector2 Reflect(Vector2 inDirection, Vector2 inNormal)
Parameters
Returns
|
Improve this Doc
View Source
Scale(Vector2)
Declaration
public void Scale(Vector2 scale)
Parameters
Type |
Name |
Description |
Vector2 |
scale |
|
|
Improve this Doc
View Source
Scale(Vector2, Vector2)
Declaration
public static Vector2 Scale(Vector2 a, Vector2 b)
Parameters
Returns
|
Improve this Doc
View Source
Set(Single, Single)
Declaration
public void Set(float newX, float newY)
Parameters
|
Improve this Doc
View Source
SignedAngle(Vector2, Vector2)
Declaration
public static float SignedAngle(Vector2 from, Vector2 to)
Parameters
Returns
|
Improve this Doc
View Source
SmoothDamp(Vector2, Vector2, ref Vector2, Single)
Declaration
[ExcludeFromDocs]
public static Vector2 SmoothDamp(Vector2 current, Vector2 target, ref Vector2 currentVelocity, float smoothTime)
Parameters
Returns
|
Improve this Doc
View Source
SmoothDamp(Vector2, Vector2, ref Vector2, Single, Single)
Declaration
[ExcludeFromDocs]
public static Vector2 SmoothDamp(Vector2 current, Vector2 target, ref Vector2 currentVelocity, float smoothTime, float maxSpeed)
Parameters
Returns
|
Improve this Doc
View Source
SmoothDamp(Vector2, Vector2, ref Vector2, Single, Single, Single)
Declaration
public static Vector2 SmoothDamp(Vector2 current, Vector2 target, ref Vector2 currentVelocity, float smoothTime, [DefaultValue("Mathf.Infinity")] float maxSpeed, [DefaultValue("Time.deltaTime")] float deltaTime)
Parameters
Returns
|
Improve this Doc
View Source
SqrMagnitude()
Declaration
public float SqrMagnitude()
Returns
|
Improve this Doc
View Source
SqrMagnitude(Vector2)
Declaration
public static float SqrMagnitude(Vector2 a)
Parameters
Returns
|
Improve this Doc
View Source
ToString()
Declaration
public override string ToString()
Returns
Overrides
|
Improve this Doc
View Source
ToString(String)
Declaration
public string ToString(string format)
Parameters
Type |
Name |
Description |
String |
format |
|
Returns
Operators
|
Improve this Doc
View Source
Addition(Vector2, Vector2)
Declaration
public static Vector2 operator +(Vector2 a, Vector2 b)
Parameters
Returns
|
Improve this Doc
View Source
Division(Vector2, Single)
Declaration
public static Vector2 operator /(Vector2 a, float d)
Parameters
Returns
|
Improve this Doc
View Source
Division(Vector2, Vector2)
Declaration
public static Vector2 operator /(Vector2 a, Vector2 b)
Parameters
Returns
|
Improve this Doc
View Source
Equality(Vector2, Vector2)
Declaration
public static bool operator ==(Vector2 lhs, Vector2 rhs)
Parameters
Returns
|
Improve this Doc
View Source
Implicit(Vector2 to Vector3)
Declaration
public static implicit operator Vector3(Vector2 v)
Parameters
Returns
|
Improve this Doc
View Source
Implicit(Vector3 to Vector2)
Declaration
public static implicit operator Vector2(Vector3 v)
Parameters
Returns
|
Improve this Doc
View Source
Inequality(Vector2, Vector2)
Declaration
public static bool operator !=(Vector2 lhs, Vector2 rhs)
Parameters
Returns
|
Improve this Doc
View Source
Multiply(Single, Vector2)
Declaration
public static Vector2 operator *(float d, Vector2 a)
Parameters
Returns
|
Improve this Doc
View Source
Multiply(Vector2, Single)
Declaration
public static Vector2 operator *(Vector2 a, float d)
Parameters
Returns
|
Improve this Doc
View Source
Multiply(Vector2, Vector2)
Declaration
public static Vector2 operator *(Vector2 a, Vector2 b)
Parameters
Returns
|
Improve this Doc
View Source
Subtraction(Vector2, Vector2)
Declaration
public static Vector2 operator -(Vector2 a, Vector2 b)
Parameters
Returns
|
Improve this Doc
View Source
UnaryNegation(Vector2)
Declaration
public static Vector2 operator -(Vector2 a)
Parameters
Returns
Implements
Extension Methods