private void OnGUI()
    {
        Vector2 center = Camera.main.WorldToScreenPoint(poi.BoundingBox.center);

        center.y         = Screen.height - center.y;
        rectangle.center = center;
        if (max.z >= 0.0f && min.z >= 0.0f)
        {
            rectangle.xMin = Mathf.Clamp(min.x, 0.0f, Screen.width);
            rectangle.yMin = Mathf.Clamp(Screen.height - min.y, 0.0f, Screen.height);
            rectangle.xMax = Mathf.Clamp(max.x, 0.0f, Screen.width);
            rectangle.yMax = Mathf.Clamp(Screen.height - max.y, 0.0f, Screen.height);
            GUI.color      = poi.GetColor();
            //GUI.Box(rectangle, RectangleContent/*, RectangleStyle*/);
            if (PoiManager.Instance.GetLevelBoundariesVisibility())
            {
                GUI.DrawTexture(rectangle, backgroundImage /*, backgroundImage, RectangleStyle*/);
            }
            percentageOnScreen = (rectangle.xMax - rectangle.xMin) * (rectangle.yMin - rectangle.yMax) / (Screen.width * Screen.height);
        }
        else
        {
            percentageOnScreen = 0.0f;
        }
        poi.SetCurrentPercentageOnScreenTaken(percentageOnScreen);
    }
Beispiel #2
0
 private void OnDrawGizmos()
 {
     Gizmos.color = poi.GetColor();
     if (poi.BoundingBox != null)
     {
         Gizmos.DrawWireCube(poi.BoundingBox.center, poi.BoundingBox.size);
     }
 }