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