Пример #1
0
 public static VRDeviceInfoEditor[] GetEnabledVRDeviceInfo(BuildTargetGroup targetGroup)
 {
     string[] enabledVRDevices = VREditor.GetVREnabledDevicesOnTargetGroup(targetGroup);
     return((from d in VREditor.GetAllVRDeviceInfo(targetGroup)
             where enabledVRDevices.Contains(d.deviceNameKey)
             select d).ToArray <VRDeviceInfoEditor>());
 }
 private void RefreshVRDeviceList(BuildTargetGroup targetGroup)
 {
     VRDeviceInfoEditor[] array = VREditor.GetAllVRDeviceInfo(targetGroup);
     array = (from d in array
              orderby d.deviceNameUI
              select d).ToArray <VRDeviceInfoEditor>();
     this.m_AllVRDevicesForBuildTarget[targetGroup] = array;
     for (int i = 0; i < array.Length; i++)
     {
         VRDeviceInfoEditor vRDeviceInfoEditor = array[i];
         this.m_MapVRDeviceKeyToUIString[vRDeviceInfoEditor.deviceNameKey] = vRDeviceInfoEditor.deviceNameUI;
         this.m_MapVRUIStringToDeviceKey[vRDeviceInfoEditor.deviceNameUI]  = vRDeviceInfoEditor.deviceNameKey;
         VRCustomOptions vRCustomOptions;
         if (!this.m_CustomOptions.TryGetValue(vRDeviceInfoEditor.deviceNameKey, out vRCustomOptions))
         {
             Type type = Type.GetType("UnityEditorInternal.VR.VRCustomOptions" + vRDeviceInfoEditor.deviceNameKey, false, true);
             if (type != null)
             {
                 vRCustomOptions = (VRCustomOptions)Activator.CreateInstance(type);
             }
             else
             {
                 vRCustomOptions = new VRCustomOptionsNone();
             }
             vRCustomOptions.Initialize(this.m_Settings.serializedObject);
             this.m_CustomOptions.Add(vRDeviceInfoEditor.deviceNameKey, vRCustomOptions);
         }
     }
 }
Пример #3
0
        private void RefreshVRDeviceList(BuildTargetGroup targetGroup)
        {
            VRDeviceInfoEditor[] deviceInfos = VREditor.GetAllVRDeviceInfo(targetGroup);
            deviceInfos = deviceInfos.OrderBy(d => d.deviceNameUI).ToArray();
            m_AllVRDevicesForBuildTarget[targetGroup] = deviceInfos;

            for (int i = 0; i < deviceInfos.Length; ++i)
            {
                VRDeviceInfoEditor deviceInfo = deviceInfos[i];
                m_MapVRDeviceKeyToUIString[deviceInfo.deviceNameKey] = deviceInfo.deviceNameUI;
                m_MapVRUIStringToDeviceKey[deviceInfo.deviceNameUI]  = deviceInfo.deviceNameKey;

                // Create custom UI options if they exist for this sdk
                VRCustomOptions customOptions;
                if (!m_CustomOptions.TryGetValue(deviceInfo.deviceNameKey, out customOptions))
                {
                    Type optionsType = Type.GetType("UnityEditorInternal.VR.VRCustomOptions" + deviceInfo.deviceNameKey, false, true);
                    if (optionsType != null)
                    {
                        customOptions = (VRCustomOptions)Activator.CreateInstance(optionsType);
                    }
                    else
                    {
                        customOptions = new VRCustomOptionsNone();
                    }
                    customOptions.Initialize(m_Settings.serializedObject);
                    m_CustomOptions.Add(deviceInfo.deviceNameKey, customOptions);
                }
            }
        }
Пример #4
0
 public static string[] GetAvailableVirtualRealitySDKs(BuildTargetGroup targetGroup)
 {
     VRDeviceInfoEditor[] allVRDeviceInfo = VREditor.GetAllVRDeviceInfo(targetGroup);
     string[]             array           = new string[allVRDeviceInfo.Length];
     for (int i = 0; i < allVRDeviceInfo.Length; i++)
     {
         array[i] = allVRDeviceInfo[i].deviceNameKey;
     }
     return(array);
 }
Пример #5
0
 private void RefreshVRDeviceList(BuildTargetGroup targetGroup)
 {
     VRDeviceInfoEditor[] allVRDeviceInfo = VREditor.GetAllVRDeviceInfo(targetGroup);
     this.m_AllVRDevicesForBuildTarget[targetGroup] = allVRDeviceInfo;
     for (int i = 0; i < allVRDeviceInfo.Length; i++)
     {
         VRDeviceInfoEditor vRDeviceInfoEditor = allVRDeviceInfo[i];
         this.m_MapVRDeviceKeyToUIString[vRDeviceInfoEditor.deviceNameKey] = vRDeviceInfoEditor.deviceNameUI;
         this.m_MapVRUIStringToDeviceKey[vRDeviceInfoEditor.deviceNameUI]  = vRDeviceInfoEditor.deviceNameKey;
     }
 }
 private void CheckDevicesRequireInstall(BuildTargetGroup targetGroup)
 {
     this.m_InstallsRequired = false;
     if (!this.m_VuforiaInstalled)
     {
         VRDeviceInfoEditor[] allVRDeviceInfo = VREditor.GetAllVRDeviceInfo(targetGroup);
         for (int i = 0; i < allVRDeviceInfo.Length; i++)
         {
             if (allVRDeviceInfo[i].deviceNameKey.ToLower() == "vuforia")
             {
                 this.m_VuforiaInstalled = true;
                 break;
             }
         }
         if (!this.m_VuforiaInstalled)
         {
             this.m_InstallsRequired = true;
         }
     }
 }
Пример #7
0
        private static IEnumerable <PluginDesc> RegisterSpatializerPlugins(BuildTarget target)
        {
            List <PluginDesc> list = new List <PluginDesc>();

            if (AudioUtil.canUseSpatializerEffect)
            {
                string pluginFolder = VRPostProcess.GetPluginFolder(target);
                if (pluginFolder != null)
                {
                    VRDeviceInfoEditor[] allVRDeviceInfo = VREditor.GetAllVRDeviceInfo(BuildPipeline.GetBuildTargetGroup(target));
                    string currentSpatializerEffectName  = AudioUtil.GetCurrentSpatializerEffectName();
                    for (int i = 0; i < allVRDeviceInfo.Length; i++)
                    {
                        if (currentSpatializerEffectName == allVRDeviceInfo[i].spatializerEffectName)
                        {
                            string[] paths = new string[]
                            {
                                pluginFolder,
                                allVRDeviceInfo[i].spatializerPluginName
                            };
                            string text = FileUtil.CombinePaths(paths) + VRPostProcess.GetPluginExtension(target, true);
                            if (File.Exists(text) || Directory.Exists(text))
                            {
                                list.Add(new PluginDesc
                                {
                                    pluginPath = text
                                });
                                Debug.LogWarning("Native Spatializer Plugin: " + allVRDeviceInfo[i].spatializerPluginName + " was included in build.");
                                break;
                            }
                        }
                    }
                    if (!list.Any <PluginDesc>())
                    {
                        Debug.LogWarning("Spatializer Effect: " + currentSpatializerEffectName + ", is not natively supported for the current build target.");
                    }
                }
            }
            return(list);
        }
Пример #8
0
        private void CheckDevicesRequireInstall(BuildTargetGroup targetGroup)
        {
            // Reset
            m_InstallsRequired = false;

            if (!m_VuforiaInstalled)
            {
                VRDeviceInfoEditor[] deviceInfos = VREditor.GetAllVRDeviceInfo(targetGroup);

                for (int i = 0; i < deviceInfos.Length; ++i)
                {
                    if (deviceInfos[i].deviceNameKey.ToLower() == "vuforia")
                    {
                        m_VuforiaInstalled = true;
                        break;
                    }
                }

                if (!m_VuforiaInstalled)
                {
                    m_InstallsRequired = true;
                }
            }
        }