コード例 #1
0
    public static void DrawLabel(Vector3 point, string label, Color color, int yOffset)
    {
        Vector3?vector = GameObject.Find("MainCamera").GetComponent <Camera>().WorldToScreenPoint(point);

        if (vector.HasValue)
        {
            Vector3 value = vector.Value;
            if (value.z > 0f)
            {
                Vector2 vector2 = GUIUtility.ScreenToGUIPoint(value);
                vector2.y = Screen.height - (vector2.y + yOffset);// 1f
                CustomCanvas.DrawString(vector2, color, CustomCanvas.TextFlags.TEXT_FLAG_OUTLINED, label);
            }
        }
    }