private void ShowLanduseElement(LanduseSettings element) { EditorGUILayout.BeginVertical("box"); { LanduseKind saveKind = element.Type; element.Type = (LanduseKind)EditorGUILayout.EnumPopup("Type Landuse:", element.Type); if (GUI.changed && saveKind != element.Type) { if (UsingType.Contains("lt_" + saveKind.ToString())) { UsingType.Remove("lt_" + saveKind.ToString()); } UsingType.Add("lt_" + element.Type.ToString()); } element.Material = (Material)EditorGUILayout.ObjectField("Material", element.Material, typeof(Material)); if (element.Material == null) { DisplayErrorMEssage("Not setting material"); } } EditorGUILayout.EndVertical(); }
protected LanduseSettings createLanduseSettings(LanduseKind type, string material) { var ls = new LanduseSettings(); ls.Type = type; ls.Material = (Material)Resources.Load(material, typeof(Material)); return(ls); }