LazyBot/Assets/Scripts/Utility/UtilityData.cs
/// <summary>
/// Returns direction based on (z) angle.
/// </summary>
/// <param name="angleInDegrees">Angle in degrees.</param>
/// <param name="euler">Euler angle.</param>
/// <param name="rotation">Rotation value.</param>
/// <param name="angleIsGlobal">Is angle global.</param>
/// <returns></returns>
Returns direction based on (z) angle.
Returns direction based on ( z ) angle .
public static Vector3 DirFromAngleZ(this float angleInDegrees, float euler = 0, float rotation = 0, bool angleIsGlobal = false)
        {
            if (!angleIsGlobal)
            {
                angleInDegrees += euler + rotation;
            }
            return new Vector3(Mathf.Cos(angleInDegrees * Mathf.Deg2Rad), Mathf.Sin(angleInDegrees * Mathf.Deg2Rad), 0);
        }
public static Vector3 DirFromAngleZ ( this float angleInDegrees , float euler = 0 , float rotation = 0 , bool angleIsGlobal = false ) { if ( ! angleIsGlobal ) { angleInDegrees += euler + rotation ; } return new Vector3 ( Mathf . Cos ( angleInDegrees * Mathf . Deg2Rad ) , Mathf . Sin ( angleInDegrees * Mathf . Deg2Rad ) , 0 ) ; }
Returns direction based on (z) angle.
Returns direction based on ( z ) angle .
None
float
this
euler
float
None
rotation
float
None
angleIsGlobal
bool
None
angleInDegrees
Angle in degrees.
Angle in degrees .