From ded822e98e8eda49618d17e53407b0df1896e539 Mon Sep 17 00:00:00 2001 From: chai Date: Fri, 22 Apr 2022 19:24:15 +0800 Subject: * rename AlienSurvival project to SurvivalTest --- .../Assets/Scripts/TopDown/TopDownUtils.cs | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 SurvivalTest/Assets/Scripts/TopDown/TopDownUtils.cs (limited to 'SurvivalTest/Assets/Scripts/TopDown/TopDownUtils.cs') diff --git a/SurvivalTest/Assets/Scripts/TopDown/TopDownUtils.cs b/SurvivalTest/Assets/Scripts/TopDown/TopDownUtils.cs new file mode 100644 index 0000000..f42e123 --- /dev/null +++ b/SurvivalTest/Assets/Scripts/TopDown/TopDownUtils.cs @@ -0,0 +1,25 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class TopDownUtils +{ + + /// + /// 从TopDown空间转到3D空间下(TopDownTransform -> Transform) + /// + /// + /// + /// + public static Vector3 Project(Vector3 topDownCoord, float z = 0) + { + Vector3 pos = new Vector3(); + + pos.x = topDownCoord.x; + pos.y = topDownCoord.y + topDownCoord.z; + pos.z = z; + + return pos; + } + +} \ No newline at end of file -- cgit v1.1-26-g67d0