diff --git a/FileUtilities/DataLoader.cs b/FileUtilities/DataLoader.cs
index ffa25ce..f6634c0 100644
--- a/FileUtilities/DataLoader.cs
+++ b/FileUtilities/DataLoader.cs
@@ -374,6 +374,36 @@ public static bool TryFindFullPath(string filePath, DataLocation location,
return false;
}
+ ///
+ /// Attempts to find the full directory path for the passed in DataLocation
+ ///
+ /// The data location type to try to find a directory path for
+ /// The full data path to the desired data location
+ /// The data loader to get a data location from
+ /// True if the directory was found for the desired loader type, otherwise false
+ public static bool TryGetLocationPath(DataLocation location, out string directoryPath)
+ {
+ if (s_primaryDataLoaderPath is TLoader)
+ {
+ directoryPath = $"{s_primaryDataLoaderPath.GetDataPath(location)}";
+
+ return true;
+ }
+
+ foreach (IDataLoaderPath fallbackPath in FallbackDataLoaderPaths)
+ {
+ if (fallbackPath is TLoader)
+ {
+ directoryPath = $"{fallbackPath.GetDataPath(location)}";
+
+ return true;
+ }
+ }
+
+ directoryPath = string.Empty;
+ return false;
+ }
+
///
/// Helper function used to load JSON data from a file path
///
@@ -517,4 +547,4 @@ private static bool ReadAllXml(string filePath,
data = rootNode.ChildNodes;
return true;
}
-}
\ No newline at end of file
+}
diff --git a/FileUtilities/FileUtilities.csproj b/FileUtilities/FileUtilities.csproj
index 54ed9f9..f6d2c57 100644
--- a/FileUtilities/FileUtilities.csproj
+++ b/FileUtilities/FileUtilities.csproj
@@ -11,8 +11,8 @@
FileUtilities
FluffyVoid
Collection of file IO utilities including the Data Loader framework that can load file data from user defined data locations.
- 1.0.3
- 1.0.3
+ 1.0.4
+ 1.0.4
FluffyVoid.FileUtilities
https://github.com/ashiryn/FileUtilities