void objectToList(GameObject obj) { if (obj) { foreach (var paintObj in param.objects) { if (paintObj.prefab == null) { paintObj.prefab = obj; return; } } param.listSize++; PaintObject paint = new PaintObject(); paint.prefab = obj; param.objects.Add(paint); } }
public static void display(PaintObject obj, bool displayVisual) { if (obj == null) { return; } Edit.Column(() => { obj.isDisplayed = EditorGUILayout.Foldout(obj.isDisplayed, obj.prefab ? obj.prefab.name : "Empty", true); if (obj.isDisplayed) { Edit.Row(() => { Edit.Indent(() => { if (displayVisual) { GUILayout.Label(AssetPreview.GetAssetPreview(obj.prefab)); } Edit.Column(() => { obj.prefab = (GameObject)EditorGUILayout.ObjectField("Prefab", obj.prefab, typeof(GameObject), true); if (obj.prefab != null) { if (obj.customName.Length == 0 && obj.prefab) { obj.customName = obj.prefab.name; } obj.customName = EditorGUILayout.TextField("Name", obj.customName); obj.scale = EditorGUILayout.Vector2Field("Scale Modifier (Min/Max) :", obj.scale); } }); }, 1); }); } }); }