public static void OnDrawCube(GameObject gameObject, GizmoType type) { if (m_listPointHitData != null && m_listPointHitData.Count > 0) { Gizmos.color = HitCubeColor; for (int index = 0; index < m_listPointHitData.Count; index++) { Vector3 footPoint = m_listPointHitData[index].Key; ICubeData data = m_listPointHitData[index].Value; DrawCube(footPoint, data); } } if (m_listPointGrabData != null && m_listPointGrabData.Count > 0) { Gizmos.color = GrabCubeColor; for (int index = 0; index < m_listPointGrabData.Count; index++) { Vector3 footPoint = m_listPointGrabData[index].Key; ICubeData data = m_listPointGrabData[index].Value; DrawCube(footPoint, data); } } if (m_listPointBlockData != null && m_listPointBlockData.Count > 0) { Gizmos.color = BlockCubeColor; for (int index = 0; index < m_listPointBlockData.Count; index++) { Vector3 footPoint = m_listPointBlockData[index].Key; ICubeData data = m_listPointBlockData[index].Value; DrawCube(footPoint, data); } } }
private static void DrawCube(Vector3 originPoint, ICubeData data) { Vector3 footPoint = originPoint + data.GetOffset(); footPoint.x += data.GetWidth() / 2; footPoint.y += data.GetHeight() / 2; Gizmos.DrawWireCube(footPoint, data.GetSize()); }