Class MixedRealityToolkitFiles
API for working with MixedRealityToolkit folders contained in the project.
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.Utilities.Editor
Assembly: cs.temp.dll.dll
Syntax
public static class MixedRealityToolkitFiles
Fields
DirectorySearchDepth
Directory levels to search for MRTK folders below the root directory.
Declaration
public const int DirectorySearchDepth = 3
Field Value
Type | Description |
---|---|
Int32 |
Remarks
E.g. with level 3 and folders ROOT/A/B/C/D would seach A and B and C, but not D.
Properties
AreFoldersAvailable
Are any of the MRTK directories available?
Declaration
public static bool AreFoldersAvailable { get; }
Property Value
Type | Description |
---|---|
Boolean |
MRTKDirectories
Returns a collection of MRTK directories found in the project.
Declaration
public static IEnumerable<string> MRTKDirectories { get; }
Property Value
Type | Description |
---|---|
IEnumerable<String> |
Methods
FindMatchingModule(String, out MixedRealityToolkitModuleType)
Declaration
public static bool FindMatchingModule(string path, out MixedRealityToolkitModuleType result)
Parameters
Type | Name | Description |
---|---|---|
String | path | |
Mixed |
result |
Returns
Type | Description |
---|---|
Boolean |
GetAssetDatabasePath(String)
Maps an absolute path to be relative to the Project Root path (the Unity folder that contains Assets)
Declaration
public static string GetAssetDatabasePath(string absolutePath)
Parameters
Type | Name | Description |
---|---|---|
String | absolutePath | The absolute path to the project/ |
Returns
Type | Description |
---|---|
String | The project relative path. |
Remarks
This doesn't produce paths that contain step out '..' relative paths.
GetDirectories(MixedRealityToolkitModuleType)
Declaration
public static IEnumerable<string> GetDirectories(MixedRealityToolkitModuleType module)
Parameters
Type | Name | Description |
---|---|---|
Mixed |
module |
Returns
Type | Description |
---|---|
IEnumerable<String> |
GetFiles(MixedRealityToolkitModuleType, String)
Returns files from all folder instances of the MRTK folder relative path.
Declaration
public static string[] GetFiles(MixedRealityToolkitModuleType module, string mrtkRelativeFolder)
Parameters
Type | Name | Description |
---|---|---|
Mixed |
module | |
String | mrtkRelativeFolder | The MRTK folder relative path to the target folder. |
Returns
Type | Description |
---|---|
String[] | The array of files. |
GetFiles(String)
Returns files from all folder instances of the MRTK folder relative path.
Declaration
public static string[] GetFiles(string mrtkRelativeFolder)
Parameters
Type | Name | Description |
---|---|---|
String | mrtkRelativeFolder | The MRTK folder relative path to the target folder. |
Returns
Type | Description |
---|---|
String[] | The array of files. |
MapModulePath(MixedRealityToolkitModuleType)
Declaration
public static string MapModulePath(MixedRealityToolkitModuleType module)
Parameters
Type | Name | Description |
---|---|---|
Mixed |
module |
Returns
Type | Description |
---|---|
String |
MapRelativeFilePath(MixedRealityToolkitModuleType, String)
Maps a single relative path file to a concrete path from one of the MRTK folders, if found. Otherwise returns null.
Declaration
public static string MapRelativeFilePath(MixedRealityToolkitModuleType module, string mrtkPathToFile)
Parameters
Type | Name | Description |
---|---|---|
Mixed |
module | |
String | mrtkPathToFile | The MRTK folder relative path to the file. |
Returns
Type | Description |
---|---|
String | The project relative path to the file. |
MapRelativeFilePath(String)
Maps a single relative path file to a concrete path from one of the MRTK folders, if found. Otherwise returns null.
Declaration
public static string MapRelativeFilePath(string mrtkPathToFile)
Parameters
Type | Name | Description |
---|---|---|
String | mrtkPathToFile | The MRTK folder relative path to the file. |
Returns
Type | Description |
---|---|
String | The project relative path to the file. |
MapRelativeFilePathToAbsolutePath(MixedRealityToolkitModuleType, String)
Overload of MapRelativeFilePathToAbsolutePath which provides the ability to specify the module that the file belongs to.
Declaration
public static string MapRelativeFilePathToAbsolutePath(MixedRealityToolkitModuleType module, string mrtkPathToFile)
Parameters
Type | Name | Description |
---|---|---|
Mixed |
module | |
String | mrtkPathToFile |
Returns
Type | Description |
---|---|
String |
Remarks
When searching for a resource that lives in the MixedRealityToolkit.SDK folder, this could be invoked in this way: MapRelativeFilePathToAbsolutePath(MixedRealityToolkitModuleType.SDK, mrtkPathToFile)
MapRelativeFilePathToAbsolutePath(String)
Maps a single relative path file to MRTK folders to its absolute path, if found. Otherwise returns null.
Declaration
public static string MapRelativeFilePathToAbsolutePath(string mrtkPathToFile)
Parameters
Type | Name | Description |
---|---|---|
String | mrtkPathToFile |
Returns
Type | Description |
---|---|
String |
Remarks
For example, this will map "Inspectors\Data\EditorWindowOptions.json" to its full path like "c:\project\Assets\Libs\MRTK\MixedRealityToolkit\Inspectors\Data\EditorWindowOptions.json". This assumes that the passed in mrtkPathToFile is found under the "MixedRealityToolkit" folder (instead of the MixedRealityToolkit.SDK, or any of the other folders).
MapRelativeFolderPathToAbsolutePath(MixedRealityToolkitModuleType, String)
Similar to MapRelativeFilePathToAbsolutePath, except this checks for the existence of a folder instead of file.
Declaration
public static string MapRelativeFolderPathToAbsolutePath(MixedRealityToolkitModuleType module, string mrtkPathToFolder)
Parameters
Type | Name | Description |
---|---|---|
Mixed |
module | |
String | mrtkPathToFolder |
Returns
Type | Description |
---|---|
String |
RefreshFolders()
This function is only exposed for testing purposes, and can change/be removed at any time.
Declaration
public static void RefreshFolders()
Remarks
Syncronously refreshes the MRTK folder database.