{"_id":"594949e72be16d0026ec0507","category":{"_id":"594949e62be16d0026ec04db","version":"594949e52be16d0026ec04cd","project":"571fa55ca0acd42000af9545","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-01-01T17:01:47.129Z","from_sync":false,"order":13,"slug":"utilities","title":"Utilities"},"project":"571fa55ca0acd42000af9545","user":"571fa519db52d01700f5cf3d","parentDoc":null,"version":{"_id":"594949e52be16d0026ec04cd","project":"571fa55ca0acd42000af9545","__v":2,"createdAt":"2017-06-20T16:14:29.816Z","releaseDate":"2017-06-20T16:14:29.816Z","categories":["594949e62be16d0026ec04ce","594949e62be16d0026ec04cf","594949e62be16d0026ec04d0","594949e62be16d0026ec04d1","594949e62be16d0026ec04d2","594949e62be16d0026ec04d3","594949e62be16d0026ec04d4","594949e62be16d0026ec04d5","594949e62be16d0026ec04d6","594949e62be16d0026ec04d7","594949e62be16d0026ec04d8","594949e62be16d0026ec04d9","594949e62be16d0026ec04da","594949e62be16d0026ec04db","594949e62be16d0026ec04dc","594949e62be16d0026ec04dd","594949e62be16d0026ec04de","594949e62be16d0026ec04df","594949e62be16d0026ec04e0","594949e62be16d0026ec04e1","59497219f4a8980024dd0631"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"Kunekune","version_clean":"3.2.0","version":"3.2.0"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-01-01T17:02:13.466Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"## Overview\n\nThe SDK Manager script provides configuration of supported SDKs and manages a list of VRTK_SDKSetup scripts to use.\n\n## Inspector Parameters\n\n * **Persist On Load:** If this is true then the instance of the SDK Manager won't be destroyed on every scene load.\n * **Auto Manage Script Defines:** Determines whether the scripting define symbols required by the installed SDKs are automatically added to and removed from the player settings.\n * **Script Alias Left Controller:** A reference to the GameObject that contains any scripts that apply to the Left Hand Controller.\n * **Script Alias Right Controller:** A reference to the GameObject that contains any scripts that apply to the Right Hand Controller.\n * **Auto Manage VR Settings:** Determines whether the VR settings of the Player Settings are automatically adjusted to allow for all the used SDKs in the SDK Setups list below.\n * **Auto Load Setup:** Determines whether the SDK Setups list below is used whenever the SDK Manager is enabled. The first loadable Setup is then loaded.\n * **Setups:** The list of SDK Setups to choose from.\n\n## Class Variables\n\n * `public readonly SDK_ScriptingDefineSymbolPredicateAttribute attribute` - The predicate attribute.\n * `public readonly MethodInfo methodInfo` - The method info of the method the attribute is defined on.\n * `public static ReadOnlyCollection<ScriptingDefineSymbolPredicateInfo> AvailableScriptingDefineSymbolPredicateInfos { get private set }` - All found scripting define symbol predicate attributes with associated method info.\n * `public static readonly Dictionary<Type, Type> SDKFallbackTypesByBaseType` - Specifies the fallback SDK types for every base SDK type. Default: `new Dictionary<Type, Type>`\n * `public static ReadOnlyCollection<VRTK_SDKInfo> AvailableSystemSDKInfos { get private set }` - All available system SDK infos.\n * `public static ReadOnlyCollection<VRTK_SDKInfo> AvailableBoundariesSDKInfos { get private set }` - All available boundaries SDK infos.\n * `public static ReadOnlyCollection<VRTK_SDKInfo> AvailableHeadsetSDKInfos { get private set }` - All available headset SDK infos.\n * `public static ReadOnlyCollection<VRTK_SDKInfo> AvailableControllerSDKInfos { get private set }` - All available controller SDK infos.\n * `public static ReadOnlyCollection<VRTK_SDKInfo> InstalledSystemSDKInfos { get private set }` - All installed system SDK infos. This is a subset of  . It contains only those available SDK infos for which an  exists that uses the same symbol and whose associated method returns true.\n * `public static ReadOnlyCollection<VRTK_SDKInfo> InstalledBoundariesSDKInfos { get private set }` - All installed boundaries SDK infos. This is a subset of  . It contains only those available SDK infos for which an  exists that uses the same symbol and whose associated method returns true.\n * `public static ReadOnlyCollection<VRTK_SDKInfo> InstalledHeadsetSDKInfos { get private set }` - All installed headset SDK infos. This is a subset of  . It contains only those available SDK infos for which an  exists that uses the same symbol and whose associated method returns true.\n * `public static ReadOnlyCollection<VRTK_SDKInfo> InstalledControllerSDKInfos { get private set }` - All installed controller SDK infos. This is a subset of  . It contains only those available SDK infos for which an  exists that uses the same symbol and whose associated method returns true.\n * `public static VRTK_SDKManager instance` - The singleton instance to access the SDK Manager variables from.\n * `public List<SDK_ScriptingDefineSymbolPredicateAttribute> activeScriptingDefineSymbolsWithoutSDKClasses` - The active (i.e. to be added to the  ) scripting define symbol predicate attributes that have no associated SDK classes. Default: `new List<SDK_ScriptingDefineSymbolPredicateAttribute>()`\n * `public VRTK_SDKSetup loadedSetup { get private set }` - The loaded SDK Setup.  if no setup is currently loaded.\n * `public ReadOnlyCollection<Behaviour> behavioursToToggleOnLoadedSetupChange { get private set }` - All behaviours that need toggling whenever  changes.\n\n## Class Events\n\n * `LoadedSetupChanged` - The event invoked whenever the loaded SDK Setup changes.\n\n## Unity Events\n\nAdding the `VRTK_SDKManager_UnityEvents` component to `VRTK_SDKManager` object allows access to `UnityEvents` that will react identically to the Class Events.\n\n * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`.\n\n## Event Payload\n\n * `VRTK_SDKSetup previousSetup` - The previous loaded Setup.  if no previous Setup was loaded.\n * `VRTK_SDKSetup currentSetup` - The current loaded Setup.  if no Setup is loaded anymore. See  to check whether this is  because of an error.\n * `string errorMessage` - Explains why loading a list of Setups wasn't successful if  is  and an error occurred.  if no error occurred.\n\n## Class Methods\n\n### ScriptingDefineSymbolPredicateInfo/2\n\n  > `public ScriptingDefineSymbolPredicateInfo(SDK_ScriptingDefineSymbolPredicateAttribute attribute, MethodInfo methodInfo)`\n\n  * Parameters\n   * `SDK_ScriptingDefineSymbolPredicateAttribute attribute` - The predicate attribute.\n   * `MethodInfo methodInfo` - The method info of the method the attribute is defined on.\n  * Returns\n   * _none_\n\nEvent Payload. Constructs a new instance with the specified predicate attribute and associated method info.\n\n### ManageScriptingDefineSymbols/2\n\n  > `public bool ManageScriptingDefineSymbols(bool ignoreAutoManageScriptDefines, bool ignoreIsActiveAndEnabled)`\n\n  * Parameters\n   * `bool ignoreAutoManageScriptDefines` - Whether to ignore  while deciding to manage.\n   * `bool ignoreIsActiveAndEnabled` - Whether to ignore  while deciding to manage.\n  * Returns\n   * `bool` - Whether the ' scripting define symbols were changed.\n\nManages (i.e. adds and removes) the scripting define symbols of the  for the currently set SDK infos. This method is only available in the editor, so usage of the method needs to be surrounded by `#if UNITY_EDITOR` and `#endif` when used in a type that is also compiled for a standalone build.\n\n### ManageVRSettings/1\n\n  > `public void ManageVRSettings(bool force)`\n\n  * Parameters\n   * `bool force` - Whether to ignore  while deciding to manage.\n  * Returns\n   * _none_\n\nManages (i.e. adds and removes) the VR SDKs of the  for the currently set SDK infos. This method is only available in the editor, so usage of the method needs to be surrounded by `#if UNITY_EDITOR` and `#endif` when used in a type that is also compiled for a standalone build.\n\n### AddBehaviourToToggleOnLoadedSetupChange/1\n\n  > `public void AddBehaviourToToggleOnLoadedSetupChange(Behaviour behaviour)`\n\n  * Parameters\n   * `Behaviour behaviour` - The behaviour to add.\n  * Returns\n   * _none_\n\nAdds a behaviour to the list of behaviours to toggle when  changes.\n\n### RemoveBehaviourToToggleOnLoadedSetupChange/1\n\n  > `public void RemoveBehaviourToToggleOnLoadedSetupChange(Behaviour behaviour)`\n\n  * Parameters\n   * `Behaviour behaviour` - The behaviour to remove.\n  * Returns\n   * _none_\n\nRemoves a behaviour of the list of behaviours to toggle when  changes.\n\n### TryLoadSDKSetupFromList/1\n\n  > `public void TryLoadSDKSetupFromList(bool tryUseLastLoadedSetup = true)`\n\n  * Parameters\n   * _none_\n  * Returns\n   * _none_\n\nTries to load a valid  from  .\n\n### TryLoadSDKSetup/3\n\n  > `public void TryLoadSDKSetup(int startIndex, bool tryToReinitialize, params VRTK_SDKSetup[] sdkSetups)`\n\n  * Parameters\n   * `int startIndex` - The index of the  to start the loading with.\n   * `bool tryToReinitialize` - Whether or not to retry initializing and using the currently set but unusable VR Device.\n   * `params VRTK_SDKSetup[] sdkSetups` - The list to try to load a  from.\n  * Returns\n   * _none_\n\nTries to load a valid  from a list. The first loadable  in the list will be loaded. Will fall back to disable VR if none of the provided Setups is useable.\n\n### SetLoadedSDKSetupToPopulateObjectReferences/1\n\n  > `public void SetLoadedSDKSetupToPopulateObjectReferences(VRTK_SDKSetup setup)`\n\n  * Parameters\n   * `VRTK_SDKSetup setup` - The SDK Setup to set as the loaded SDK.\n  * Returns\n   * _none_\n\nSets a given  as the loaded SDK Setup to be able to use it when populating object references in the SDK Setup. This method should only be called when not playing as it's only for populating the object references. This method is only available in the editor, so usage of the method needs to be surrounded by `#if UNITY_EDITOR` and `#endif` when used in a type that is also compiled for a standalone build.\n\n### UnloadSDKSetup/1\n\n  > `public void UnloadSDKSetup(bool disableVR = false)`\n\n  * Parameters\n   * `bool disableVR` - Whether to disable VR altogether after unloading the SDK Setup.\n  * Returns\n   * _none_\n\nUnloads the currently loaded  , if there is one.","excerpt":"","slug":"vrtk_sdkmanager","type":"basic","title":"VRTK_SDKManager"}
## Overview The SDK Manager script provides configuration of supported SDKs and manages a list of VRTK_SDKSetup scripts to use. ## Inspector Parameters * **Persist On Load:** If this is true then the instance of the SDK Manager won't be destroyed on every scene load. * **Auto Manage Script Defines:** Determines whether the scripting define symbols required by the installed SDKs are automatically added to and removed from the player settings. * **Script Alias Left Controller:** A reference to the GameObject that contains any scripts that apply to the Left Hand Controller. * **Script Alias Right Controller:** A reference to the GameObject that contains any scripts that apply to the Right Hand Controller. * **Auto Manage VR Settings:** Determines whether the VR settings of the Player Settings are automatically adjusted to allow for all the used SDKs in the SDK Setups list below. * **Auto Load Setup:** Determines whether the SDK Setups list below is used whenever the SDK Manager is enabled. The first loadable Setup is then loaded. * **Setups:** The list of SDK Setups to choose from. ## Class Variables * `public readonly SDK_ScriptingDefineSymbolPredicateAttribute attribute` - The predicate attribute. * `public readonly MethodInfo methodInfo` - The method info of the method the attribute is defined on. * `public static ReadOnlyCollection<ScriptingDefineSymbolPredicateInfo> AvailableScriptingDefineSymbolPredicateInfos { get private set }` - All found scripting define symbol predicate attributes with associated method info. * `public static readonly Dictionary<Type, Type> SDKFallbackTypesByBaseType` - Specifies the fallback SDK types for every base SDK type. Default: `new Dictionary<Type, Type>` * `public static ReadOnlyCollection<VRTK_SDKInfo> AvailableSystemSDKInfos { get private set }` - All available system SDK infos. * `public static ReadOnlyCollection<VRTK_SDKInfo> AvailableBoundariesSDKInfos { get private set }` - All available boundaries SDK infos. * `public static ReadOnlyCollection<VRTK_SDKInfo> AvailableHeadsetSDKInfos { get private set }` - All available headset SDK infos. * `public static ReadOnlyCollection<VRTK_SDKInfo> AvailableControllerSDKInfos { get private set }` - All available controller SDK infos. * `public static ReadOnlyCollection<VRTK_SDKInfo> InstalledSystemSDKInfos { get private set }` - All installed system SDK infos. This is a subset of . It contains only those available SDK infos for which an exists that uses the same symbol and whose associated method returns true. * `public static ReadOnlyCollection<VRTK_SDKInfo> InstalledBoundariesSDKInfos { get private set }` - All installed boundaries SDK infos. This is a subset of . It contains only those available SDK infos for which an exists that uses the same symbol and whose associated method returns true. * `public static ReadOnlyCollection<VRTK_SDKInfo> InstalledHeadsetSDKInfos { get private set }` - All installed headset SDK infos. This is a subset of . It contains only those available SDK infos for which an exists that uses the same symbol and whose associated method returns true. * `public static ReadOnlyCollection<VRTK_SDKInfo> InstalledControllerSDKInfos { get private set }` - All installed controller SDK infos. This is a subset of . It contains only those available SDK infos for which an exists that uses the same symbol and whose associated method returns true. * `public static VRTK_SDKManager instance` - The singleton instance to access the SDK Manager variables from. * `public List<SDK_ScriptingDefineSymbolPredicateAttribute> activeScriptingDefineSymbolsWithoutSDKClasses` - The active (i.e. to be added to the ) scripting define symbol predicate attributes that have no associated SDK classes. Default: `new List<SDK_ScriptingDefineSymbolPredicateAttribute>()` * `public VRTK_SDKSetup loadedSetup { get private set }` - The loaded SDK Setup. if no setup is currently loaded. * `public ReadOnlyCollection<Behaviour> behavioursToToggleOnLoadedSetupChange { get private set }` - All behaviours that need toggling whenever changes. ## Class Events * `LoadedSetupChanged` - The event invoked whenever the loaded SDK Setup changes. ## Unity Events Adding the `VRTK_SDKManager_UnityEvents` component to `VRTK_SDKManager` object allows access to `UnityEvents` that will react identically to the Class Events. * All C# delegate events are mapped to a Unity Event with the `On` prefix. e.g. `MyEvent` -> `OnMyEvent`. ## Event Payload * `VRTK_SDKSetup previousSetup` - The previous loaded Setup. if no previous Setup was loaded. * `VRTK_SDKSetup currentSetup` - The current loaded Setup. if no Setup is loaded anymore. See to check whether this is because of an error. * `string errorMessage` - Explains why loading a list of Setups wasn't successful if is and an error occurred. if no error occurred. ## Class Methods ### ScriptingDefineSymbolPredicateInfo/2 > `public ScriptingDefineSymbolPredicateInfo(SDK_ScriptingDefineSymbolPredicateAttribute attribute, MethodInfo methodInfo)` * Parameters * `SDK_ScriptingDefineSymbolPredicateAttribute attribute` - The predicate attribute. * `MethodInfo methodInfo` - The method info of the method the attribute is defined on. * Returns * _none_ Event Payload. Constructs a new instance with the specified predicate attribute and associated method info. ### ManageScriptingDefineSymbols/2 > `public bool ManageScriptingDefineSymbols(bool ignoreAutoManageScriptDefines, bool ignoreIsActiveAndEnabled)` * Parameters * `bool ignoreAutoManageScriptDefines` - Whether to ignore while deciding to manage. * `bool ignoreIsActiveAndEnabled` - Whether to ignore while deciding to manage. * Returns * `bool` - Whether the ' scripting define symbols were changed. Manages (i.e. adds and removes) the scripting define symbols of the for the currently set SDK infos. This method is only available in the editor, so usage of the method needs to be surrounded by `#if UNITY_EDITOR` and `#endif` when used in a type that is also compiled for a standalone build. ### ManageVRSettings/1 > `public void ManageVRSettings(bool force)` * Parameters * `bool force` - Whether to ignore while deciding to manage. * Returns * _none_ Manages (i.e. adds and removes) the VR SDKs of the for the currently set SDK infos. This method is only available in the editor, so usage of the method needs to be surrounded by `#if UNITY_EDITOR` and `#endif` when used in a type that is also compiled for a standalone build. ### AddBehaviourToToggleOnLoadedSetupChange/1 > `public void AddBehaviourToToggleOnLoadedSetupChange(Behaviour behaviour)` * Parameters * `Behaviour behaviour` - The behaviour to add. * Returns * _none_ Adds a behaviour to the list of behaviours to toggle when changes. ### RemoveBehaviourToToggleOnLoadedSetupChange/1 > `public void RemoveBehaviourToToggleOnLoadedSetupChange(Behaviour behaviour)` * Parameters * `Behaviour behaviour` - The behaviour to remove. * Returns * _none_ Removes a behaviour of the list of behaviours to toggle when changes. ### TryLoadSDKSetupFromList/1 > `public void TryLoadSDKSetupFromList(bool tryUseLastLoadedSetup = true)` * Parameters * _none_ * Returns * _none_ Tries to load a valid from . ### TryLoadSDKSetup/3 > `public void TryLoadSDKSetup(int startIndex, bool tryToReinitialize, params VRTK_SDKSetup[] sdkSetups)` * Parameters * `int startIndex` - The index of the to start the loading with. * `bool tryToReinitialize` - Whether or not to retry initializing and using the currently set but unusable VR Device. * `params VRTK_SDKSetup[] sdkSetups` - The list to try to load a from. * Returns * _none_ Tries to load a valid from a list. The first loadable in the list will be loaded. Will fall back to disable VR if none of the provided Setups is useable. ### SetLoadedSDKSetupToPopulateObjectReferences/1 > `public void SetLoadedSDKSetupToPopulateObjectReferences(VRTK_SDKSetup setup)` * Parameters * `VRTK_SDKSetup setup` - The SDK Setup to set as the loaded SDK. * Returns * _none_ Sets a given as the loaded SDK Setup to be able to use it when populating object references in the SDK Setup. This method should only be called when not playing as it's only for populating the object references. This method is only available in the editor, so usage of the method needs to be surrounded by `#if UNITY_EDITOR` and `#endif` when used in a type that is also compiled for a standalone build. ### UnloadSDKSetup/1 > `public void UnloadSDKSetup(bool disableVR = false)` * Parameters * `bool disableVR` - Whether to disable VR altogether after unloading the SDK Setup. * Returns * _none_ Unloads the currently loaded , if there is one.