public static void DrawIsoWireCube(Vector3 center, Vector3 size) { var half = size / 2; // draw front Gizmos.DrawLine(Isometric.IsoToUnitySpace(center + new Vector3(-half.x, -half.y, half.z)), Isometric.IsoToUnitySpace(center + new Vector3(half.x, -half.y, half.z))); Gizmos.DrawLine(Isometric.IsoToUnitySpace(center + new Vector3(-half.x, -half.y, half.z)), Isometric.IsoToUnitySpace(center + new Vector3(-half.x, half.y, half.z))); Gizmos.DrawLine(Isometric.IsoToUnitySpace(center + new Vector3(half.x, half.y, half.z)), Isometric.IsoToUnitySpace(center + new Vector3(half.x, -half.y, half.z))); Gizmos.DrawLine(Isometric.IsoToUnitySpace(center + new Vector3(half.x, half.y, half.z)), Isometric.IsoToUnitySpace(center + new Vector3(-half.x, half.y, half.z))); // draw back Gizmos.DrawLine(Isometric.IsoToUnitySpace(center + new Vector3(-half.x, -half.y, -half.z)), Isometric.IsoToUnitySpace(center + new Vector3(half.x, -half.y, -half.z))); Gizmos.DrawLine(Isometric.IsoToUnitySpace(center + new Vector3(-half.x, -half.y, -half.z)), Isometric.IsoToUnitySpace(center + new Vector3(-half.x, half.y, -half.z))); Gizmos.DrawLine(Isometric.IsoToUnitySpace(center + new Vector3(half.x, half.y, -half.z)), Isometric.IsoToUnitySpace(center + new Vector3(half.x, -half.y, -half.z))); Gizmos.DrawLine(Isometric.IsoToUnitySpace(center + new Vector3(half.x, half.y, -half.z)), Isometric.IsoToUnitySpace(center + new Vector3(-half.x, half.y, -half.z))); // draw corners Gizmos.DrawLine(Isometric.IsoToUnitySpace(center + new Vector3(-half.x, -half.y, -half.z)), Isometric.IsoToUnitySpace(center + new Vector3(-half.x, -half.y, half.z))); Gizmos.DrawLine(Isometric.IsoToUnitySpace(center + new Vector3(half.x, -half.y, -half.z)), Isometric.IsoToUnitySpace(center + new Vector3(half.x, -half.y, half.z))); Gizmos.DrawLine(Isometric.IsoToUnitySpace(center + new Vector3(-half.x, half.y, -half.z)), Isometric.IsoToUnitySpace(center + new Vector3(-half.x, half.y, half.z))); Gizmos.DrawLine(Isometric.IsoToUnitySpace(center + new Vector3(half.x, half.y, -half.z)), Isometric.IsoToUnitySpace(center + new Vector3(half.x, half.y, half.z))); }
public static void DrawIsoLine(Vector3 from, Vector3 to) { Gizmos.DrawLine(Isometric.IsoToUnitySpace(from), Isometric.IsoToUnitySpace(to)); }