public static string FilePath(GUIContent label, string path, string relativeTo, string extension = null, FilePathOptions options = FilePathOptions.NONE) { Rect rect = getBaseRect(); rect = EditorGUI.PrefixLabel(rect, label, prefixLabelStyle); string returnPath = FilePathButton(rect, path, relativeTo, extension); if(!hasFilePathFlag(options, FilePathOptions.KEEP_EXTENTION) && returnPath != null) { returnPath = returnPath.Replace("." + extension, ""); } return returnPath; }
public static string FilePath(string labelText, string path, string relativeTo, string extension = null, FilePathOptions options = FilePathOptions.NONE) { return FilePath(new GUIContent(labelText), path, relativeTo, extension, options); }
static bool hasFilePathFlag(FilePathOptions options, FilePathOptions flag) { return (options & flag) == flag; }
public static string FilePath(string labelText, string path, string relativeTo, string extension = null, FilePathOptions options = FilePathOptions.NONE) { return FilePath(new GUIContent(labelText), path, relativeTo, extension, options); }
public static string FilePath(GUIContent label, string path, string relativeTo, string extension = null, FilePathOptions options = FilePathOptions.NONE) { Rect rect = getBaseRect(); rect = EditorGUI.PrefixLabel(rect, label, prefixLabelStyle); string returnPath = FilePathButton(rect, path, relativeTo, extension); if(!hasFilePathFlag(options, FilePathOptions.KEEP_EXTENTION)){ returnPath = returnPath.Replace("." + extension, ""); } return returnPath; }
static bool hasFilePathFlag(FilePathOptions options, FilePathOptions flag) { return (options & flag) == flag; }