C# Class UnityCommonLibrary.Utility.Math2DUtility

显示文件 Open project: thebeardphantom/UnityCommonLibrary

Public Methods

Method Description
Angle ( Transform a, Transform b ) : float
Angle ( Vector2 a, Vector2 b ) : float
AngleRaw ( Transform a, Transform b ) : float
AngleRaw ( Vector2 a, Vector2 b ) : float
IsFacingRight ( float angle ) : bool
LookAt2D ( this t, Transform other ) : void
LookAt2D ( this t, Vector2 other ) : void
SetForward2D ( this t, Vector2 forward ) : void
ToNormalized ( float angle ) : float

Returns an angle from 0...360

Method Details

Angle() public static method

public static Angle ( Transform a, Transform b ) : float
a UnityEngine.Transform
b UnityEngine.Transform
return float

Angle() public static method

public static Angle ( Vector2 a, Vector2 b ) : float
a UnityEngine.Vector2
b UnityEngine.Vector2
return float

AngleRaw() public static method

public static AngleRaw ( Transform a, Transform b ) : float
a UnityEngine.Transform
b UnityEngine.Transform
return float

AngleRaw() public static method

public static AngleRaw ( Vector2 a, Vector2 b ) : float
a UnityEngine.Vector2
b UnityEngine.Vector2
return float

IsFacingRight() public static method

public static IsFacingRight ( float angle ) : bool
angle float
return bool

LookAt2D() public static method

public static LookAt2D ( this t, Transform other ) : void
t this
other UnityEngine.Transform
return void

LookAt2D() public static method

public static LookAt2D ( this t, Vector2 other ) : void
t this
other UnityEngine.Vector2
return void

SetForward2D() public static method

public static SetForward2D ( this t, Vector2 forward ) : void
t this
forward UnityEngine.Vector2
return void

ToNormalized() public static method

Returns an angle from 0...360
public static ToNormalized ( float angle ) : float
angle float
return float