protected override void OnLayoutDraw()
 {
     if (Filters != null && Filters.Length > 0)
     {
         Value = EGUILayout.DrawOpenFileWithFilter(Text, Value, Filters, IsAbsolute, IsTextEditable);
     }
     else
     {
         Value = EGUILayout.DrawOpenFile(Text, Value, Extension, IsAbsolute, IsTextEditable);
     }
 }
Exemplo n.º 2
0
        protected override void OnDrawProperty(string label)
        {
            string value = DrawerProperty.GetValue <string>();
            var    attr  = GetAttr <OpenFilePathAttribute>();

            EditorGUI.BeginChangeCheck();
            {
                if (attr.Filters != null && attr.Filters.Length > 0)
                {
                    value = EGUILayout.DrawOpenFileWithFilter(label, value, attr.Filters, attr.IsAbsolute);
                }
                else
                {
                    value = EGUILayout.DrawOpenFile(label, value, attr.Extension, attr.IsAbsolute);
                }
            }
            if (EditorGUI.EndChangeCheck())
            {
                DrawerProperty.Value = value;
            }
        }