예제 #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
파일: Preset.cs 프로젝트: JocysCom/PassGen
 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
파일: Preset.cs 프로젝트: tforsberg/PassGen
        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);
        }