GUIColor() private static méthode

private static GUIColor ( Rect rect, UnityEditor.SerializedProperty colorProp ) : void
rect UnityEngine.Rect
colorProp UnityEditor.SerializedProperty
Résultat void
Exemple #1
0
        public void GUIMinMaxGradient(GUIContent label, SerializedMinMaxGradient minMaxGradient)
        {
            MinMaxGradientState state = minMaxGradient.state;
            bool flag      = state >= MinMaxGradientState.k_RandomBetweenTwoColors;
            Rect rect      = GUILayoutUtility.GetRect(0f, (float)((!flag) ? 13 : 26));
            Rect popupRect = ModuleUI.GetPopupRect(rect);

            rect = ModuleUI.SubtractPopupWidth(rect);
            Rect rect2 = ModuleUI.PrefixLabel(rect, label);

            rect2.height = 13f;
            switch (state)
            {
            case MinMaxGradientState.k_Color:
                ModuleUI.GUIColor(rect2, minMaxGradient.m_MaxColor);
                break;

            case MinMaxGradientState.k_Gradient:
                EditorGUI.GradientField(rect2, minMaxGradient.m_MaxGradient);
                break;

            case MinMaxGradientState.k_RandomBetweenTwoColors:
                ModuleUI.GUIColor(rect2, minMaxGradient.m_MaxColor);
                rect2.y += rect2.height;
                ModuleUI.GUIColor(rect2, minMaxGradient.m_MinColor);
                break;

            case MinMaxGradientState.k_RandomBetweenTwoGradients:
                EditorGUI.GradientField(rect2, minMaxGradient.m_MaxGradient);
                rect2.y += rect2.height;
                EditorGUI.GradientField(rect2, minMaxGradient.m_MinGradient);
                break;
            }
            ModuleUI.GUIMMGradientPopUp(popupRect, minMaxGradient);
        }
Exemple #2
0
        public void GUIMinMaxColor(GUIContent label, SerializedMinMaxColor minMaxColor)
        {
            Rect  rect1 = ModuleUI.PrefixLabel(ModuleUI.GetControlRect(13), label);
            float width = (float)((double)rect1.width - 13.0 - 5.0);

            if (!minMaxColor.minMax.boolValue)
            {
                ModuleUI.GUIColor(new Rect(rect1.x, rect1.y, width, rect1.height), minMaxColor.maxColor);
            }
            else
            {
                Rect rect2 = new Rect(rect1.x, rect1.y, (float)((double)width * 0.5 - 2.0), rect1.height);
                ModuleUI.GUIColor(rect2, minMaxColor.minColor);
                rect2.x += rect2.width + 4f;
                ModuleUI.GUIColor(rect2, minMaxColor.maxColor);
            }
            ModuleUI.GUIMMColorPopUp(new Rect(rect1.xMax - 13f, rect1.y, 13f, 13f), minMaxColor.minMax);
        }
Exemple #3
0
        public void GUIMinMaxColor(GUIContent label, SerializedMinMaxColor minMaxColor)
        {
            Rect totalPosition = ModuleUI.GetControlRect(13);

            totalPosition = ModuleUI.PrefixLabel(totalPosition, label);
            float num = totalPosition.width - 13f - 5f;

            if (!minMaxColor.minMax.boolValue)
            {
                Rect rect = new Rect(totalPosition.x, totalPosition.y, num, totalPosition.height);
                ModuleUI.GUIColor(rect, minMaxColor.maxColor);
            }
            else
            {
                Rect rect2 = new Rect(totalPosition.x, totalPosition.y, num * 0.5f - 2f, totalPosition.height);
                ModuleUI.GUIColor(rect2, minMaxColor.minColor);
                rect2.x += rect2.width + 4f;
                ModuleUI.GUIColor(rect2, minMaxColor.maxColor);
            }
            Rect rect3 = new Rect(totalPosition.xMax - 13f, totalPosition.y, 13f, 13f);

            ModuleUI.GUIMMColorPopUp(rect3, minMaxColor.minMax);
        }