Beispiel #1
0
 public static void DrawSphereHandle(Vector3 position, float size, Color inactiveColor, Color activeColor)
 {
     if (CustomHandles.InsideHandleOnGUI(position))
     {
         DebugDraw.DrawSphere(position, size, activeColor);
     }
     else
     {
         DebugDraw.DrawSphere(position, size, inactiveColor);
     }
 }
Beispiel #2
0
    public static void DrawSquareTextureAtWorldPoint(Vector3 position, float width, Texture texture, Texture textureSelected)
    {
        Vector3 screenPoint = Camera.main.WorldToScreenPoint(position).SwapScreenToWorldPoint();
        Rect    rect        = new Rect(screenPoint.x - width / 2f, screenPoint.y - width / 2f, width, width);

        if (CustomHandles.InsideHandleOnGUI(position))
        {
            GUI.DrawTexture(rect, textureSelected);
        }
        else
        {
            GUI.DrawTexture(rect, texture);
        }
    }