diff options
author | chai <215380520@qq.com> | 2023-05-09 13:14:14 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2023-05-09 13:14:14 +0800 |
commit | f986dc197b5e093575bc0b56ee0ded991c228639 (patch) | |
tree | bf13c22f38d9186422daa9b200f16143fc003464 /marching/Assets/Scripts/Utils/Vector3Extension.cs | |
parent | c35533e31efe30121a7c61a725fdaaba47714296 (diff) |
*misc
Diffstat (limited to 'marching/Assets/Scripts/Utils/Vector3Extension.cs')
-rw-r--r-- | marching/Assets/Scripts/Utils/Vector3Extension.cs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/marching/Assets/Scripts/Utils/Vector3Extension.cs b/marching/Assets/Scripts/Utils/Vector3Extension.cs new file mode 100644 index 0000000..5afe941 --- /dev/null +++ b/marching/Assets/Scripts/Utils/Vector3Extension.cs @@ -0,0 +1,26 @@ +using System.Collections; +using System.Collections.Generic; +using Unity.VisualScripting; +using UnityEditor; +using UnityEngine; + +public static class Vector3Extension +{ + + public static Vector2 xy(this Vector3 src) + { + Vector2 xy = new Vector2(); + xy.x = src.x; + xy.y = src.y; + return xy; + } + + public static Vector2 ToVector2(this Vector3 src) + { + Vector2 xy = new Vector2(); + xy.x = src.x; + xy.y = src.y; + return xy; + } + +} |