private void ShowBoundaryElement(BoundarySettings element) { EditorGUILayout.BeginVertical("box"); { BoundaryType saveKind = element.Type; element.Type = (BoundaryType)EditorGUILayout.EnumPopup("Type Boundary:", element.Type); if (GUI.changed && saveKind != element.Type) { if (UsingType.Contains("bt_" + saveKind.ToString())) { UsingType.Remove("bt_" + saveKind.ToString()); } UsingType.Add("bt_" + element.Type.ToString()); } element.Material = (Material)EditorGUILayout.ObjectField("Material", element.Material, typeof(Material)); if (element.Material == null) { DisplayErrorMEssage("Not setting material"); } element.Width = EditorGUILayout.FloatField("Boundary Width", element.Width); } EditorGUILayout.EndVertical(); }
public void SetBoundaryType(string name, BoundaryType bt) { FoamDictionaryListFile f = new FoamDictionaryListFile(FoamConst.GetBoundaryFileNameFromVxt(vxtFileName)); f.Read(); if (!f.Dictionary.IsNull) { foreach (KeyValuePair <string, FoamDictionary> k in f.Dictionary) { if (k.Key == name) { FoamDictionary cv = k.Value; cv.SetChild("type", bt.ToString()); cv.RemoveChild("inGroups"); } } } f.Write(); }