Struct Vector2
- Namespace
- VMagicMirror.Buddy
UnityEngineのVector2とほぼ同等のことが出来るようなデータです。
public struct Vector2 : IEquatable<Vector2>
- Implements
- Inherited Members
Constructors
Vector2(float, float)
public Vector2(float x, float y)
Parameters
Fields
x
public float x
Field Value
y
public float y
Field Value
Properties
down
public static Vector2 down { get; }
Property Value
left
public static Vector2 left { get; }
Property Value
magnitude
public float magnitude { get; }
Property Value
normalized
public Vector2 normalized { get; }
Property Value
one
public static Vector2 one { get; }
Property Value
right
public static Vector2 right { get; }
Property Value
sqrMagnitude
public float sqrMagnitude { get; }
Property Value
up
public static Vector2 up { get; }
Property Value
zero
public static Vector2 zero { get; }
Property Value
Methods
Distance(Vector2, Vector2)
public static float Distance(Vector2 a, Vector2 b)
Parameters
Returns
Dot(Vector2, Vector2)
public static float Dot(Vector2 lhs, Vector2 rhs)
Parameters
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object other)
Parameters
other
object
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
Equals(Vector2)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Vector2 other)
Parameters
other
Vector2An object to compare with this object.
Returns
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
Lerp(Vector2, Vector2, float)
public static Vector2 Lerp(Vector2 a, Vector2 b, float t)
Parameters
Returns
LerpUnclamped(Vector2, Vector2, float)
public static Vector2 LerpUnclamped(Vector2 a, Vector2 b, float t)
Parameters
Returns
Normalize()
public void Normalize()
Scale(Vector2)
public void Scale(Vector2 scale)
Parameters
scale
Vector2
Scale(Vector2, Vector2)
public static Vector2 Scale(Vector2 a, Vector2 b)
Parameters
Returns
Set(float, float)
public void Set(float newX, float newY)
Parameters
SqrMagnitude()
public float SqrMagnitude()
Returns
SqrMagnitude(Vector2)
public static float SqrMagnitude(Vector2 a)
Parameters
a
Vector2
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator +(Vector2, Vector2)
public static Vector2 operator +(Vector2 a, Vector2 b)
Parameters
Returns
operator /(Vector2, float)
public static Vector2 operator /(Vector2 a, float d)
Parameters
Returns
operator /(Vector2, Vector2)
public static Vector2 operator /(Vector2 a, Vector2 b)
Parameters
Returns
operator ==(Vector2, Vector2)
public static bool operator ==(Vector2 lhs, Vector2 rhs)
Parameters
Returns
implicit operator Vector3(Vector2)
public static implicit operator Vector3(Vector2 v)
Parameters
v
Vector2
Returns
implicit operator Vector2(Vector3)
public static implicit operator Vector2(Vector3 v)
Parameters
v
Vector3
Returns
operator !=(Vector2, Vector2)
public static bool operator !=(Vector2 lhs, Vector2 rhs)
Parameters
Returns
operator *(float, Vector2)
public static Vector2 operator *(float d, Vector2 a)
Parameters
Returns
operator *(Vector2, float)
public static Vector2 operator *(Vector2 a, float d)
Parameters
Returns
operator *(Vector2, Vector2)
public static Vector2 operator *(Vector2 a, Vector2 b)
Parameters
Returns
operator -(Vector2, Vector2)
public static Vector2 operator -(Vector2 a, Vector2 b)
Parameters
Returns
operator -(Vector2)
public static Vector2 operator -(Vector2 a)
Parameters
a
Vector2