/// <summary> /// The GetSimplifiedErrorDescriptions method checks the setup for errors and creates an array of error descriptions. /// </summary> /// <remarks> /// The returned error descriptions handle the following cases for the current SDK infos: /// <list type="bullet"> /// <item> <description>Its type doesn't exist anymore.</description> </item> /// <item> <description>It's a fallback SDK.</description> </item> /// <item> <description>It doesn't have its scripting define symbols added.</description> </item> /// <item> <description>It's missing its vendor SDK.</description> </item> /// </list> /// Additionally the current SDK infos are checked whether they use multiple VR Devices. /// </remarks> /// <returns>An array of all the error descriptions. Returns an empty array if no errors are found.</returns> public string[] GetSimplifiedErrorDescriptions() { List <string> sdkErrorDescriptions = new List <string>(); ReadOnlyCollection <VRTK_SDKInfo>[] installedSDKInfosList = { VRTK_SDKManager.InstalledSystemSDKInfos, VRTK_SDKManager.InstalledBoundariesSDKInfos, VRTK_SDKManager.InstalledHeadsetSDKInfos, VRTK_SDKManager.InstalledControllerSDKInfos, VRTK_SDKManager.InstalledTrackerSDKInfos, VRTK_SDKManager.InstalledHandSDKInfos }; VRTK_SDKInfo[] currentSDKInfos = { systemSDKInfo, boundariesSDKInfo, headsetSDKInfo, controllerSDKInfo, trackerSDKInfo, handSDKInfo }; for (int index = 0; index < installedSDKInfosList.Length; index++) { ReadOnlyCollection <VRTK_SDKInfo> installedSDKInfos = installedSDKInfosList[index]; VRTK_SDKInfo currentSDKInfo = currentSDKInfos[index]; Type baseType = VRTK_SharedMethods.GetBaseType(currentSDKInfo.type); if (baseType == null) { continue; } if (currentSDKInfo.originalTypeNameWhenFallbackIsUsed != null) { sdkErrorDescriptions.Add(string.Format("The SDK '{0}' doesn't exist anymore.", currentSDKInfo.originalTypeNameWhenFallbackIsUsed)); } else if (currentSDKInfo.description.describesFallbackSDK) { sdkErrorDescriptions.Add("A fallback SDK is used. Make sure to set a real SDK."); } else if (!installedSDKInfos.Contains(currentSDKInfo)) { sdkErrorDescriptions.Add(string.Format("The vendor SDK for '{0}' is not installed.", currentSDKInfo.description.prettyName)); } } if (usedVRDeviceNames.Except(new[] { "None" }).Count() > 1) { sdkErrorDescriptions.Add("The current SDK selection uses multiple VR Devices. It's not possible to use more than one VR Device at the same time."); } return(sdkErrorDescriptions.Distinct().ToArray()); }