blob: f42e12374ea3b6b131b29002ce3ea1da7100e09b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TopDownUtils
{
/// <summary>
/// 从TopDown空间转到3D空间下(TopDownTransform -> Transform)
/// </summary>
/// <param name="topDownCoord"></param>
/// <param name="z"></param>
/// <returns></returns>
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;
}
}
|