private void ForceNewMeshButton() { if (GUILayout.Button(new GUIContent("Force new mesh", "For use with prefab meshes! This creates a new mesh with the same settings, disconnecting it from any prefab connections it might have. Can undo!"))) { for (int i = 0; i < targets.Length; ++i) { SuperPlane plane = targets[i] as SuperPlane; if (plane == null) { continue; } Undo.RecordObject(plane, "Force new mesh"); plane.ForceNewMesh(); } } }