UnityEditor.ClothInspector.DrawColorBox C# (CSharp) Method

DrawColorBox() public method

public DrawColorBox ( Texture gradientTex, Color col ) : void
gradientTex UnityEngine.Texture
col Color
return void
        public void DrawColorBox(Texture gradientTex, Color col)
        {
            if (!GUI.enabled)
            {
                col = new Color(0.3f, 0.3f, 0.3f, 1f);
                EditorGUI.showMixedValue = false;
            }
            GUILayout.BeginVertical(new GUILayoutOption[0]);
            GUILayout.Space(5f);
            GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.Height(10f) };
            Rect position = GUILayoutUtility.GetRect(new GUIContent(), GUIStyle.none, options);
            GUI.Box(position, GUIContent.none);
            position = new Rect(position.x + 1f, position.y + 1f, position.width - 2f, position.height - 2f);
            if (gradientTex != null)
            {
                GUI.DrawTexture(position, gradientTex);
            }
            else
            {
                EditorGUIUtility.DrawColorSwatch(position, col, false);
            }
            GUILayout.EndVertical();
        }