UnityEditor.ShaderVariantCollectionInspector.DrawShaderEntry C# (CSharp) Method

DrawShaderEntry() private method

private DrawShaderEntry ( int shaderIndex ) : void
shaderIndex int
return void
        private void DrawShaderEntry(int shaderIndex)
        {
            SerializedProperty arrayElementAtIndex = this.m_Shaders.GetArrayElementAtIndex(shaderIndex);
            Shader objectReferenceValue = (Shader) arrayElementAtIndex.FindPropertyRelative("first").objectReferenceValue;
            SerializedProperty property2 = arrayElementAtIndex.FindPropertyRelative("second.variants");
            using (new GUILayout.HorizontalScope(new GUILayoutOption[0]))
            {
                Rect r = GUILayoutUtility.GetRect(GUIContent.none, EditorStyles.boldLabel);
                Rect addRemoveButtonRect = GetAddRemoveButtonRect(r);
                r.xMax = addRemoveButtonRect.x;
                GUI.Label(r, objectReferenceValue.name, EditorStyles.boldLabel);
                if (GUI.Button(addRemoveButtonRect, Styles.iconRemove, Styles.invisibleButton))
                {
                    this.m_Shaders.DeleteArrayElementAtIndex(shaderIndex);
                    return;
                }
            }
            for (int i = 0; i < property2.arraySize; i++)
            {
                SerializedProperty property3 = property2.GetArrayElementAtIndex(i);
                string stringValue = property3.FindPropertyRelative("keywords").stringValue;
                if (string.IsNullOrEmpty(stringValue))
                {
                    stringValue = "<no keywords>";
                }
                PassType intValue = (PassType) property3.FindPropertyRelative("passType").intValue;
                Rect rect = GUILayoutUtility.GetRect(GUIContent.none, EditorStyles.miniLabel);
                Rect position = GetAddRemoveButtonRect(rect);
                rect.xMax = position.x;
                GUI.Label(rect, intValue + " " + stringValue, EditorStyles.miniLabel);
                if (GUI.Button(position, Styles.iconRemove, Styles.invisibleButton))
                {
                    property2.DeleteArrayElementAtIndex(i);
                }
            }
            if (GUI.Button(GetAddRemoveButtonRect(GUILayoutUtility.GetRect(GUIContent.none, EditorStyles.miniLabel)), Styles.iconAdd, Styles.invisibleButton))
            {
                this.DisplayAddVariantsWindow(objectReferenceValue, base.target as ShaderVariantCollection);
            }
        }