summaryrefslogtreecommitdiff
path: root/Assets/Scripts/Utils/VectorUtility.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-09-22 19:25:56 +0800
committerchai <chaifix@163.com>2021-09-22 19:25:56 +0800
commit2f310aa9f3f1cb1d51e8f62a6d5e3dda4821b82b (patch)
treedefb1bd9e61fc8b0575337c2fdf73754f2fd1e20 /Assets/Scripts/Utils/VectorUtility.cs
parent84fdd90eac4431fa278c11d7664c1d954f80b883 (diff)
*effect
Diffstat (limited to 'Assets/Scripts/Utils/VectorUtility.cs')
-rw-r--r--Assets/Scripts/Utils/VectorUtility.cs32
1 files changed, 32 insertions, 0 deletions
diff --git a/Assets/Scripts/Utils/VectorUtility.cs b/Assets/Scripts/Utils/VectorUtility.cs
new file mode 100644
index 00000000..b0e857e7
--- /dev/null
+++ b/Assets/Scripts/Utils/VectorUtility.cs
@@ -0,0 +1,32 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+
+public static class VectorExtend
+{
+
+ public static Vector4 ToVector4(ref this Vector3 v3, float w = 1)
+ {
+ Vector4 v4 = new Vector4(v3.x, v3.y, v3.z, 1);
+ return v4;
+ }
+
+ public static Vector3 ToVector3(ref this Vector4 v4)
+ {
+ Vector3 v3 = new Vector3(v4.x, v4.y, v4.z);
+ return v3;
+ }
+
+ public static Vector2 ToVector2(ref this Vector3 v3)
+ {
+ Vector2 v2 = new Vector2(v3.x, v3.y);
+ return v2;
+ }
+
+}
+
+public class VectorUtility
+{
+
+
+} \ No newline at end of file