/// <summary> /// Draws a rectangle based on a Rect and color /// </summary> /// <param name="rectangle">Rectangle.</param> /// <param name="color">Color.</param> public static void DrawRectangle(Rect rectangle, Color color) { if (!DebugDrawEnabled) { return; } Vector3 pos = new Vector3(rectangle.x + rectangle.width / 2, rectangle.y + rectangle.height / 2, 0.0f); Vector3 scale = new Vector3(rectangle.width, rectangle.height, 0.0f); RPGDebug.DrawRectangle(pos, color, scale); }
private void OnDrawGizmos() { if (m_portalTarget != null) { // draws an arrow from this teleporter to its destination RPGDebug.DrawGizmoArrow( this.transform.position, (m_portalTarget.transform.position + new Vector3( m_portalTarget.m_ExitOffset.x, m_portalTarget.m_ExitOffset.y, 0.0f)) - this.transform.position, Color.cyan, 1f, 25f); // draws a point at the exit position RPGDebug.DebugDrawCross(this.transform.position + new Vector3( m_ExitOffset.x, m_ExitOffset.y, 0.0f), 0.5f, Color.yellow); RPGDebug.DrawPoint(this.transform.position + new Vector3( m_ExitOffset.x, m_ExitOffset.y, 0.0f), Color.yellow, 0.5f); } }