Example #1
0
 public override void OnEnable()
 {
     base.titleContent = base.GetLocalizedTitleContent();
     this.m_RectSelection = new RectSelection(this);
     if (this.grid == null)
     {
         this.grid = new SceneViewGrid();
     }
     this.grid.Register(this);
     if (this.svRot == null)
     {
         this.svRot = new SceneViewRotation();
     }
     this.svRot.Register(this);
     base.autoRepaintOnSceneChange = true;
     this.m_Rotation.valueChanged.AddListener(new UnityAction(this.Repaint));
     this.m_Position.valueChanged.AddListener(new UnityAction(this.Repaint));
     this.m_Size.valueChanged.AddListener(new UnityAction(this.Repaint));
     this.m_Ortho.valueChanged.AddListener(new UnityAction(this.Repaint));
     base.wantsMouseMove = true;
     base.dontClearBackground = true;
     s_SceneViews.Add(this);
     this.m_Lighting = EditorGUIUtility.IconContent("SceneviewLighting", "Lighting|The scene lighting is used when toggled on. When toggled off a light attached to the scene view camera is used.");
     this.m_Fx = EditorGUIUtility.IconContent("SceneviewFx", "Fx|Toggles skybox, fog and lens flare effects.");
     this.m_AudioPlayContent = EditorGUIUtility.IconContent("SceneviewAudio", "AudioPlay|Toggles audio on or off.");
     this.m_GizmosContent = new GUIContent("Gizmos");
     this.m_2DModeContent = new GUIContent("2D");
     this.m_SceneViewOverlay = new SceneViewOverlay(this);
     EditorApplication.modifierKeysChanged = (EditorApplication.CallbackFunction) Delegate.Combine(EditorApplication.modifierKeysChanged, new EditorApplication.CallbackFunction(SceneView.RepaintAll));
     this.m_DraggingLockedState = DraggingLockedState.NotDragging;
     this.CreateSceneCameraAndLights();
     if (this.m_2DMode)
     {
         this.LookAt(this.pivot, Quaternion.identity, this.size, true, true);
     }
     base.OnEnable();
 }
Example #2
0
		public override void OnEnable()
		{
			this.m_RectSelection = new RectSelection(this);
			if (this.grid == null)
			{
				this.grid = new SceneViewGrid();
			}
			this.grid.Register(this);
			if (this.svRot == null)
			{
				this.svRot = new SceneViewRotation();
			}
			this.svRot.Register(this);
			base.autoRepaintOnSceneChange = true;
			this.m_Rotation.valueChanged.AddListener(new UnityAction(base.Repaint));
			this.m_Position.valueChanged.AddListener(new UnityAction(base.Repaint));
			this.m_Size.valueChanged.AddListener(new UnityAction(base.Repaint));
			this.m_Ortho.valueChanged.AddListener(new UnityAction(base.Repaint));
			base.wantsMouseMove = true;
			base.dontClearBackground = true;
			SceneView.s_SceneViews.Add(this);
			this.m_Lighting = EditorGUIUtility.IconContent("SceneviewLighting");
			this.m_Fx = EditorGUIUtility.IconContent("SceneviewFx");
			this.m_AudioPlayContent = EditorGUIUtility.IconContent("SceneviewAudio");
			this.m_GizmosContent = new GUIContent("Gizmos");
			this.m_2DModeContent = new GUIContent("2D");
			this.m_SceneViewOverlay = new SceneViewOverlay(this);
			EditorApplication.modifierKeysChanged = (EditorApplication.CallbackFunction)Delegate.Combine(EditorApplication.modifierKeysChanged, new EditorApplication.CallbackFunction(SceneView.RepaintAll));
			this.m_DraggingLockedState = SceneView.DraggingLockedState.NotDragging;
			this.CreateSceneCameraAndLights();
			base.OnEnable();
		}