public static void Draw(P3dPaintMaterial paintMaterial, Rect rect) { if (paintMaterial != null && paintMaterial.thumbnail != null) { GUI.DrawTexture(rect, paintMaterial.thumbnail); } else { GUI.DrawTexture(rect, Texture2D.whiteTexture); } }
private void DrawMaterialTop(float width) { EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); var rectL = EditorGUILayout.BeginHorizontal(GUILayout.Width(settings.ThumbnailSize), GUILayout.Height(settings.ThumbnailSize)); P3dPaintMaterial.Draw(currentPaintMaterial, rectL); GUILayout.Label(new GUIContent(default(Texture), "Click to choose a paint material."), GetSelectableStyle(selectingMaterial, false), GUILayout.Width(settings.ThumbnailSize), GUILayout.Height(settings.ThumbnailSize)); EditorGUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); if (currentPaintMaterial == null && selectingMaterial == false) { EditorGUILayout.HelpBox("Click the box above to choose a paint material.", MessageType.Warning); } if (Event.current.type == EventType.MouseDown && rectL.Contains(Event.current.mousePosition) == true) { nextSelectingMaterial = !selectingMaterial; } }
public static int Compare(P3dPaintMaterial a, P3dPaintMaterial b) { return(a.name.CompareTo(b.name)); }