虽然经历了固态硬盘损坏,但好在git给力,丢失的文件不多

This commit is contained in:
2023-11-28 11:09:29 +08:00
parent 697d37422b
commit 5c4faf1522
+31 -2
View File
@@ -6,7 +6,7 @@ using UnityEngine;
namespace XericLibrary.Runtime.Type namespace XericLibrary.Runtime.Type
{ {
/// <summary> /// <summary>
/// ʸ����λ /// 三维方向指示
/// </summary> /// </summary>
public enum Vector3Orientation public enum Vector3Orientation
{ {
@@ -18,7 +18,7 @@ namespace XericLibrary.Runtime.Type
Right, Right,
} }
/// <summary> /// <summary>
/// ʸ����λ /// 二维方向指示
/// </summary> /// </summary>
public enum Vector2Orientation public enum Vector2Orientation
{ {
@@ -27,4 +27,33 @@ namespace XericLibrary.Runtime.Type
Left, Left,
Right, Right,
} }
public static class OrientationExtend
{
public static Vector3 GetVector(this Vector3Orientation orient)
{
return orient switch
{
Vector3Orientation.Front => Vector3.forward,
Vector3Orientation.Back => Vector3.back,
Vector3Orientation.Up => Vector3.up,
Vector3Orientation.Down => Vector3.down,
Vector3Orientation.Left => Vector3.left,
Vector3Orientation.Right => Vector3.right,
_=> Vector3.zero,
};
}
public static Vector2 GetVector(this Vector2Orientation orient)
{
return orient switch
{
Vector2Orientation.UpFront => Vector2.up,
Vector2Orientation.DownBack => Vector2.down,
Vector2Orientation.Left => Vector2.left,
Vector2Orientation.Right => Vector2.right,
_=> Vector2.zero,
};
}
}
} }