Exemple #1
0
        private void OnGUI()
        {
            if (!Application.HasAdvancedLicense())
            {
                EditorGUILayout.HelpBox(BuildPipeline.GetBuildTargetAdvancedLicenseName(EditorUserBuildSettings.activeBuildTarget) + " is required for Occlusion Culling on " + BuildPipeline.GetBuildTargetGroupName(EditorUserBuildSettings.activeBuildTarget), MessageType.Warning);
                return;
            }
            if (OcclusionCullingWindow.s_Styles == null)
            {
                OcclusionCullingWindow.s_Styles = new OcclusionCullingWindow.Styles();
            }
            if (this.m_Mode != OcclusionCullingWindow.Mode.Visualization && !StaticOcclusionCullingVisualization.showPreVisualization)
            {
                this.m_Mode = OcclusionCullingWindow.Mode.Visualization;
            }
            EditorGUILayout.Space();
            this.ModeToggle();
            EditorGUILayout.Space();
            this.m_ScrollPosition = EditorGUILayout.BeginScrollView(this.m_ScrollPosition, new GUILayoutOption[0]);
            switch (this.m_Mode)
            {
            case OcclusionCullingWindow.Mode.AreaSettings:
                this.AreaSelectionGUI();
                break;

            case OcclusionCullingWindow.Mode.BakeSettings:
                this.BakeSettings();
                break;

            case OcclusionCullingWindow.Mode.Visualization:
                if (StaticOcclusionCulling.umbraDataSize > 0)
                {
                    this.CameraSelectionGUI();
                    GUILayout.FlexibleSpace();
                    GUILayout.Label(OcclusionCullingWindow.s_Styles.visualizationNote, EditorStyles.helpBox, new GUILayoutOption[0]);
                }
                else
                {
                    GUILayout.Label(OcclusionCullingWindow.s_Styles.noOcclusionData, EditorStyles.helpBox, new GUILayoutOption[0]);
                }
                break;
            }
            EditorGUILayout.EndScrollView();
            EditorGUILayout.Space();
            this.BakeButtons();
            EditorGUILayout.Space();
            this.SummaryGUI();
        }
 private void OnGUI()
 {
     if (OcclusionCullingWindow.s_Styles == null)
     {
         OcclusionCullingWindow.s_Styles = new OcclusionCullingWindow.Styles();
     }
     if (this.m_Mode != OcclusionCullingWindow.Mode.Visualization && !StaticOcclusionCullingVisualization.showPreVisualization)
     {
         this.m_Mode = OcclusionCullingWindow.Mode.Visualization;
     }
     EditorGUILayout.Space();
     this.ModeToggle();
     EditorGUILayout.Space();
     this.m_ScrollPosition = EditorGUILayout.BeginScrollView(this.m_ScrollPosition, new GUILayoutOption[0]);
     OcclusionCullingWindow.Mode mode = this.m_Mode;
     if (mode != OcclusionCullingWindow.Mode.AreaSettings)
     {
         if (mode != OcclusionCullingWindow.Mode.BakeSettings)
         {
             if (mode == OcclusionCullingWindow.Mode.Visualization)
             {
                 if (StaticOcclusionCulling.umbraDataSize > 0)
                 {
                     this.CameraSelectionGUI();
                     GUILayout.FlexibleSpace();
                     GUILayout.Label(OcclusionCullingWindow.s_Styles.visualizationNote, EditorStyles.helpBox, new GUILayoutOption[0]);
                 }
                 else
                 {
                     GUILayout.Label(OcclusionCullingWindow.s_Styles.noOcclusionData, EditorStyles.helpBox, new GUILayoutOption[0]);
                 }
             }
         }
         else
         {
             this.BakeSettings();
         }
     }
     else
     {
         this.AreaSelectionGUI();
     }
     EditorGUILayout.EndScrollView();
     EditorGUILayout.Space();
     this.BakeButtons();
     EditorGUILayout.Space();
     this.SummaryGUI();
 }
 private void OnGUI()
 {
   if (OcclusionCullingWindow.s_Styles == null)
     OcclusionCullingWindow.s_Styles = new OcclusionCullingWindow.Styles();
   if (this.m_Mode != OcclusionCullingWindow.Mode.Visualization && !StaticOcclusionCullingVisualization.showPreVisualization)
     this.m_Mode = OcclusionCullingWindow.Mode.Visualization;
   EditorGUILayout.Space();
   this.ModeToggle();
   EditorGUILayout.Space();
   this.m_ScrollPosition = EditorGUILayout.BeginScrollView(this.m_ScrollPosition);
   switch (this.m_Mode)
   {
     case OcclusionCullingWindow.Mode.AreaSettings:
       this.AreaSelectionGUI();
       break;
     case OcclusionCullingWindow.Mode.BakeSettings:
       this.BakeSettings();
       break;
     case OcclusionCullingWindow.Mode.Visualization:
       if (StaticOcclusionCulling.umbraDataSize > 0)
       {
         this.CameraSelectionGUI();
         GUILayout.FlexibleSpace();
         GUILayout.Label(OcclusionCullingWindow.s_Styles.visualizationNote, EditorStyles.helpBox, new GUILayoutOption[0]);
         break;
       }
       GUILayout.Label(OcclusionCullingWindow.s_Styles.noOcclusionData, EditorStyles.helpBox, new GUILayoutOption[0]);
       break;
   }
   EditorGUILayout.EndScrollView();
   EditorGUILayout.Space();
   this.BakeButtons();
   EditorGUILayout.Space();
   this.SummaryGUI();
 }
		private void OnGUI()
		{
			if (!Application.HasAdvancedLicense())
			{
				EditorGUILayout.HelpBox(BuildPipeline.GetBuildTargetAdvancedLicenseName(EditorUserBuildSettings.activeBuildTarget) + " is required for Occlusion Culling on " + BuildPipeline.GetBuildTargetGroupName(EditorUserBuildSettings.activeBuildTarget), MessageType.Warning);
				return;
			}
			if (OcclusionCullingWindow.s_Styles == null)
			{
				OcclusionCullingWindow.s_Styles = new OcclusionCullingWindow.Styles();
			}
			if (this.m_Mode != OcclusionCullingWindow.Mode.Visualization && !StaticOcclusionCullingVisualization.showPreVisualization)
			{
				this.m_Mode = OcclusionCullingWindow.Mode.Visualization;
			}
			EditorGUILayout.Space();
			this.ModeToggle();
			EditorGUILayout.Space();
			this.m_ScrollPosition = EditorGUILayout.BeginScrollView(this.m_ScrollPosition, new GUILayoutOption[0]);
			switch (this.m_Mode)
			{
			case OcclusionCullingWindow.Mode.AreaSettings:
				this.AreaSelectionGUI();
				break;
			case OcclusionCullingWindow.Mode.BakeSettings:
				this.BakeSettings();
				break;
			case OcclusionCullingWindow.Mode.Visualization:
				if (StaticOcclusionCulling.umbraDataSize > 0)
				{
					this.CameraSelectionGUI();
					GUILayout.FlexibleSpace();
					GUILayout.Label(OcclusionCullingWindow.s_Styles.visualizationNote, EditorStyles.helpBox, new GUILayoutOption[0]);
				}
				else
				{
					GUILayout.Label(OcclusionCullingWindow.s_Styles.noOcclusionData, EditorStyles.helpBox, new GUILayoutOption[0]);
				}
				break;
			}
			EditorGUILayout.EndScrollView();
			EditorGUILayout.Space();
			this.BakeButtons();
			EditorGUILayout.Space();
			this.SummaryGUI();
		}