Пример #1
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);
                }
            }
        }
 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);
         }
     }
 }