Beispiel #1
0
        public void SplashSectionGUI(BuildPlatform platform, BuildTargetGroup targetGroup, ISettingEditorExtension settingsExtension, int sectionIndex = 2)
        {
            if (m_Owner.BeginSettingsBox(sectionIndex, k_Texts.title))
            {
                if (m_Owner.m_VRSettings.TargetGroupSupportsVirtualReality(targetGroup))
                {
                    ObjectReferencePropertyField <Texture2D>(m_VirtualRealitySplashScreen, k_Texts.vrSplashScreen);
                }

                if (TargetSupportsOptionalBuiltinSplashScreen(targetGroup, settingsExtension))
                {
                    BuiltinCustomSplashScreenGUI();
                }

                if (settingsExtension != null)
                {
                    settingsExtension.SplashSectionGUI();
                }

                if (m_ShowUnitySplashScreen.boolValue)
                {
                    m_Owner.ShowSharedNote();
                }
            }
            m_Owner.EndSettingsBox();
        }
        public void SplashSectionGUI(BuildPlatform platform, ISettingEditorExtension settingsExtension, int sectionIndex = 2)
        {
            if (m_Owner.BeginSettingsBox(sectionIndex, k_Texts.title))
            {
                if (platform.namedBuildTarget == NamedBuildTarget.Server)
                {
                    PlayerSettingsEditor.ShowNoSettings();
                    EditorGUILayout.Space();
                }
                else
                {
                    ObjectReferencePropertyField <Texture2D>(m_VirtualRealitySplashScreen, k_Texts.vrSplashScreen);

                    if (TargetSupportsOptionalBuiltinSplashScreen(platform.namedBuildTarget.ToBuildTargetGroup(), settingsExtension))
                    {
                        BuiltinCustomSplashScreenGUI(platform.namedBuildTarget.ToBuildTargetGroup(), settingsExtension);
                    }

                    if (settingsExtension != null)
                    {
                        settingsExtension.SplashSectionGUI();
                    }

                    if (m_ShowUnitySplashScreen.boolValue)
                    {
                        m_Owner.ShowSharedNote();
                    }
                }
            }
            m_Owner.EndSettingsBox();
        }
        public void SplashSectionGUI(BuildPlatform platform, BuildTargetGroup targetGroup, ISettingEditorExtension settingsExtension, int sectionIndex = 2)
        {
            if (m_Owner.BeginSettingsBox(sectionIndex, k_Texts.title))
            {
                if (targetGroup == BuildTargetGroup.Standalone)
                {
                    ObjectReferencePropertyField <Texture2D>(m_ResolutionDialogBanner, k_Texts.configDialogBanner);
                    if (m_ResolutionDialogBanner.objectReferenceValue != null)
                    {
                        EditorGUILayout.HelpBox(k_Texts.configDialogBannerDeprecationWarning.text, MessageType.Warning, true);
                    }

                    EditorGUILayout.Space();
                }

                if (m_Owner.m_VRSettings.TargetGroupSupportsVirtualReality(targetGroup))
                {
                    ObjectReferencePropertyField <Texture2D>(m_VirtualRealitySplashScreen, k_Texts.vrSplashScreen);
                }

                if (TargetSupportsOptionalBuiltinSplashScreen(targetGroup, settingsExtension))
                {
                    BuiltinCustomSplashScreenGUI();
                }

                if (settingsExtension != null)
                {
                    settingsExtension.SplashSectionGUI();
                }

                if (m_ShowUnitySplashScreen.boolValue)
                {
                    m_Owner.ShowSharedNote();
                }
            }
            m_Owner.EndSettingsBox();
        }
        internal void XRSectionGUI(BuildTargetGroup targetGroup, int sectionIndex)
        {
            GUISectionIndex = sectionIndex;

            if (!TargetGroupSupportsVirtualReality(targetGroup) && !TargetGroupSupportsAugmentedReality(targetGroup))
                return;

            if (m_VRDeviceActiveUI.ContainsKey(targetGroup) && VREditor.IsDeviceListDirty(targetGroup))
            {
                VREditor.ClearDeviceListDirty(targetGroup);
                if (m_VRDeviceActiveUI.ContainsKey(targetGroup))
                {
                    m_VRDeviceActiveUI[targetGroup].list = VREditor.GetVREnabledDevicesOnTargetGroup(targetGroup);
                }
            }

            if (m_Settings.BeginSettingsBox(sectionIndex, Styles.xrSettingsTitle))
            {
                m_SharedSettingShown = false;

                if (EditorApplication.isPlaying)
                {
                    EditorGUILayout.HelpBox("Changing XR Settings is not allowed in play mode.", MessageType.Info);
                }

                using (new EditorGUI.DisabledScope(EditorApplication.isPlaying)) // switching VR flags in play mode is not supported
                {
                    bool shouldVRDeviceSettingsBeDisabled = XRProjectSettings.GetBool(XRProjectSettings.KnownSettings.k_VRDeviceDisabled, false);
                    using (new EditorGUI.DisabledGroupScope(shouldVRDeviceSettingsBeDisabled))
                    {
                        if (shouldVRDeviceSettingsBeDisabled)
                        {
                            EditorGUILayout.HelpBox("Legacy XR is currently disabled. Unity has detected that you have one or more XR SDK Provider packages installed. Legacy XR is incompatible with XR SDK. Remove all XR SDK Packages from your project to re-enable legacy XR", MessageType.Warning);

                            if (!XRProjectSettings.GetBool(XRProjectSettings.KnownSettings.k_VRDeviceDidAlertUser))
                            {
                                EditorUtility.DisplayDialog("Legacy XR Disabled", "Unity has detected that you have one or more XR SDK Provider packages installed. Legacy XR is incompatible with XR SDK. Remove all XR SDK Packages from your project to re-enable legacy XR", "Ok");
                                XRProjectSettings.SetBool(XRProjectSettings.KnownSettings.k_VRDeviceDidAlertUser, true);
                            }
                        }
                        DevicesGUI(targetGroup);

                        ErrorOnVRDeviceIncompatibility(targetGroup);
                    }

                    SinglePassStereoGUI(targetGroup, m_StereoRenderingPath);

                    TangoGUI(targetGroup);

                    VuforiaGUI(targetGroup);

                    RemotingWSAHolographicGUI(targetGroup);

                    Stereo360CaptureGUI(targetGroup);

                    ErrorOnARDeviceIncompatibility(targetGroup);

                    WarnOnGraphicsAPIIncompatibility(targetGroup);
                }

                if (m_SharedSettingShown)
                {
                    EditorGUILayout.Space();
                    m_Settings.ShowSharedNote();
                }
            }
            m_Settings.EndSettingsBox();
        }