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 == Location.PreferencesFolder)
            {
                this.filepath = InternalEditorUtility.unityPreferencesFolder + "/" + relativePath;
            }
            else if (location == Location.Library)
            {
                this.filepath = "Library/" + relativePath;
            }
            else if (location == Location.ProjectSettings)
            {
                this.filepath = "ProjectSettings/" + relativePath;
            }
            else
            {
                this.filepath = relativePath;
            }
        }
Ejemplo n.º 2
0
 public FilePathAttribute(string relativePath, FilePathAttribute.Location location)
 {
     if (string.IsNullOrEmpty(relativePath))
     {
         return;
     }
     if (relativePath[0] == '/')
     {
         relativePath = relativePath.Substring(1);
     }
     if (location == FilePathAttribute.Location.PreferencesFolder)
     {
         filepath = InternalEditorUtility.unityPreferencesFolder + "/" + relativePath;
     }
     else
     {
         filepath = relativePath;
     }
 }
Ejemplo n.º 3
0
        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 UNITY_EDITOR
            if (location == FilePathAttribute.Location.PreferencesFolder)
            {
                this.filepath = InternalEditorUtility.unityPreferencesFolder + "/" + relativePath;
            }
            else
#endif
            this.filepath = relativePath;
        }
Ejemplo n.º 4
0
 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;
         }
     }
 }