private bool ShapeVisualMaterialGUI(string name, Material material, Action <Material> onNewMaterial) { var editorData = EditorData.Instance.GetData(Shape, "Visual_" + name); var result = InspectorGUI.FoldoutObjectField(GUI.MakeLabel(name), material, typeof(Material), editorData, false) as Material; if (result != material) { onNewMaterial?.Invoke(result); } return(editorData.Bool); }