コード例 #1
0
ファイル: ThemeNodeGUI.cs プロジェクト: shshwdr/bullet
        private void DrawActionDescription()
        {
            DynamicHeight += DGUI.Properties.Space(4);
            float x              = DrawRect.x + 16;
            float lineHeight     = DGUI.Properties.SingleLineHeight;
            float iconLineHeight = lineHeight * 2;
            float iconSize       = iconLineHeight * 0.6f;
            var   iconRect       = new Rect(x, DynamicHeight + (iconLineHeight - iconSize) / 2, iconSize, iconSize);
            float textX          = iconRect.xMax + DGUI.Properties.Space(4);
            float textWidth      = DrawRect.width - iconSize - DGUI.Properties.Space(4) - 32;
            var   themeNameRect  = new Rect(textX, DynamicHeight, textWidth, lineHeight);

            DynamicHeight += themeNameRect.height;
            var variantNameRect = new Rect(textX, DynamicHeight, textWidth, lineHeight);

            DynamicHeight += variantNameRect.height;
            DynamicHeight += DGUI.Properties.Space(4);

            if (ZoomedBeyondSocketDrawThreshold)
            {
                return;
            }

            m_targetThemeName   = "---";
            m_targetVariantName = "---";

            ThemeData theme = ThemesSettings.Database.GetThemeData(TargetNode.ThemeId);

            if (theme != null)
            {
                m_targetThemeName = theme.ThemeName;
                ThemeVariantData variant = theme.GetVariant(TargetNode.VariantId);
                if (variant != null)
                {
                    m_targetVariantName = variant.VariantName;
                }
            }

            Color iconAndTextColor = (DGUI.Utility.IsProSkin ? Color.white.Darker() : Color.black.Lighter()).WithAlpha(0.6f);

            DGUI.Icon.Draw(iconRect, m_actionIcon, iconAndTextColor);
            GUI.Label(themeNameRect, m_targetThemeName, DGUI.Colors.ColorTextOfGUIStyle(DGUI.Label.Style(Editor.Size.S, TextAlign.Left), iconAndTextColor));
            GUI.Label(variantNameRect, m_targetVariantName, DGUI.Colors.ColorTextOfGUIStyle(DGUI.Label.Style(Editor.Size.M, TextAlign.Left), iconAndTextColor));
        }