public override void OnGUI(Rect position, SerializedProperty property, GUIContent label) { if (property.propertyType != SerializedPropertyType.String) { return; } PresetName presetName = PresetName.FadeIn; if (string.IsNullOrEmpty(property.stringValue) == false) { presetName = (PresetName)Enum.Parse(typeof(PresetName), property.stringValue, true); } presetName = (PresetName)EditorGUI.EnumPopup(position, label, presetName); property.stringValue = presetName.ToString(); }
public bool Load(PresetName name) { string path = string.Format(@"Security\Password\Templates\Presets\{0}.js", name.ToString()); string contents = Helper.FindResource<string>(GetType().Assembly, path); try { loadContents(contents); } catch (Exception ex) { LoadException = ex; return false; } return true; }
public bool Load(PresetName name) { string path = string.Format(@"Security\Password\Templates\Presets\{0}.js", name.ToString()); string contents = Helper.FindResource <string>(GetType().Assembly, path); try { loadContents(contents); } catch (Exception ex) { LoadException = ex; return(false); } return(true); }