示例#1
0
    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();
    }
示例#2
0
 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;
 }
示例#3
0
        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);
        }