private static string GetFilePath() { object[] customAttributes = typeof(T).GetCustomAttributes(true); foreach (object obj2 in customAttributes) { if (obj2 is FilePathAttribute) { FilePathAttribute attribute = obj2 as FilePathAttribute; return(attribute.filepath); } } return(null); }
private static string GetFilePath() { System.Type type = typeof(T); foreach (object obj2 in type.GetCustomAttributes(true)) { if (obj2 is FilePathAttribute) { FilePathAttribute attribute = obj2 as FilePathAttribute; return(attribute.filepath); } } return(null); }
private static string GetFilePath() { Type type = typeof(T); object[] atributes = type.GetCustomAttributes(true); foreach (object attr in atributes) { if (attr is FilePathAttribute) { FilePathAttribute f = attr as FilePathAttribute; return(f.filepath); } } return(null); }
public FilePathAttribute(string relativePath, FilePathAttribute.Location location) { if (string.IsNullOrEmpty(relativePath)) { Debug.LogError((object) "Invalid relative path! (its null or empty)"); } else { if ((int) relativePath[0] == 47) relativePath = relativePath.Substring(1); if (location == FilePathAttribute.Location.PreferencesFolder) this.filepath = InternalEditorUtility.unityPreferencesFolder + "/" + relativePath; else this.filepath = relativePath; } }
private static string GetFilePath() { Type typeFromHandle = typeof(T); object[] customAttributes = typeFromHandle.GetCustomAttributes(true); object[] array = customAttributes; for (int i = 0; i < array.Length; i++) { object obj = array[i]; if (obj is FilePathAttribute) { FilePathAttribute filePathAttribute = obj as FilePathAttribute; return(filePathAttribute.filepath); } } return(null); }
public FilePathAttribute(string relativePath, FilePathAttribute.Location location) { if (string.IsNullOrEmpty(relativePath)) { Debug.LogError("Invalid relative path! (its null or empty)"); return; } if (relativePath[0] == '/') { relativePath = relativePath.Substring(1); } if (location == FilePathAttribute.Location.PreferencesFolder) { this.filepath = InternalEditorUtility.unityPreferencesFolder + "/" + relativePath; } else { this.filepath = relativePath; } }