예제 #1
0
        private static IEnumerable <PluginDesc> RegisterVRPlugins(BuildTarget target)
        {
            List <PluginDesc> list = new List <PluginDesc>();

            if (PlayerSettings.virtualRealitySupported)
            {
                string pluginFolder = VRPostProcess.GetPluginFolder(target);
                if (pluginFolder != null)
                {
                    string pluginExtension = VRPostProcess.GetPluginExtension(target, false);
                    VRDeviceInfoEditor[] enabledVRDeviceInfo = VREditor.GetEnabledVRDeviceInfo(BuildPipeline.GetBuildTargetGroup(target));
                    string[]             array = (from d in enabledVRDeviceInfo
                                                  where !string.IsNullOrEmpty(d.externalPluginName)
                                                  select d.externalPluginName).ToArray <string>();
                    for (int i = 0; i < array.Length; i++)
                    {
                        string[] paths = new string[]
                        {
                            pluginFolder,
                            array[i]
                        };
                        list.Add(new PluginDesc
                        {
                            pluginPath = FileUtil.CombinePaths(paths) + pluginExtension
                        });
                    }
                }
                if (!list.Any <PluginDesc>())
                {
                    Debug.LogWarning("Unable to find plugins folder " + target + ". Native VR plugins will not be loaded.");
                }
            }
            return(list);
        }
예제 #2
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);
        }