Ver código fonte

Added dropdown menu in scene window with scene camera options. The only option for now is the scroll speed.

Robert Campbell 7 anos atrás
pai
commit
b80d1424fc

+ 2 - 0
Source/Scripting/MBansheeEditor/MBansheeEditor.csproj

@@ -113,6 +113,8 @@
     <Compile Include="Windows\Scene\Gizmos\ReflectionProbeGizmo.cs" />
     <Compile Include="Windows\Scene\Gizmos\ReflectionProbeGizmo.cs" />
     <Compile Include="Windows\Scene\Handles\HandleSlider2D.cs" />
     <Compile Include="Windows\Scene\Handles\HandleSlider2D.cs" />
     <Compile Include="Windows\Scene\Handles\HandleSliderSphere.cs" />
     <Compile Include="Windows\Scene\Handles\HandleSliderSphere.cs" />
+    <Compile Include="Windows\Scene\SceneCameraOptions.cs" />
+    <Compile Include="Windows\Scene\SceneCameraOptionsDropdown.cs" />
     <Compile Include="Window\DefaultSize.cs" />
     <Compile Include="Window\DefaultSize.cs" />
     <Compile Include="Windows\DialogBox.cs" />
     <Compile Include="Windows\DialogBox.cs" />
     <Compile Include="Utility\DragDrop.cs" />
     <Compile Include="Utility\DragDrop.cs" />

+ 12 - 19
Source/Scripting/MBansheeEditor/Windows/Scene/SceneCamera.cs

@@ -27,15 +27,6 @@ namespace BansheeEditor
         public const string HorizontalAxisBinding = "SceneHorizontal";
         public const string HorizontalAxisBinding = "SceneHorizontal";
         public const string VerticalAxisBinding = "SceneVertical";
         public const string VerticalAxisBinding = "SceneVertical";
         public const string ScrollAxisBinding = "SceneScroll";
         public const string ScrollAxisBinding = "SceneScroll";
-
-        private const float StartSpeed = 4.0f;
-        private const float TopSpeed = 12.0f;
-        private const float Acceleration = 1.0f;
-        private const float FastModeMultiplier = 2.0f;
-        private const float PanSpeed = 3.0f;
-        private const float ScrollSpeed = 3.0f;
-        private const float RotationalSpeed = 3.0f;
-        private readonly Degree FieldOfView = (Degree)90.0f;
         #endregion
         #endregion
 
 
         #region Fields
         #region Fields
@@ -87,6 +78,8 @@ namespace BansheeEditor
                 }
                 }
             }
             }
         }
         }
+
+        public SceneCameraOptions SceneCameraOptions { get; private set; } = new SceneCameraOptions();
         #endregion
         #endregion
 
 
         #region Public methods
         #region Public methods
@@ -197,7 +190,7 @@ namespace BansheeEditor
                     float horzValue = VirtualInput.GetAxisValue(horizontalAxis);
                     float horzValue = VirtualInput.GetAxisValue(horizontalAxis);
                     float vertValue = VirtualInput.GetAxisValue(verticalAxis);
                     float vertValue = VirtualInput.GetAxisValue(verticalAxis);
 
 
-                    float rotationAmount = RotationalSpeed * EditorSettings.MouseSensitivity;
+                    float rotationAmount = SceneCameraOptions.RotationalSpeed * EditorSettings.MouseSensitivity;
 
 
                     yaw += new Degree(horzValue * rotationAmount);
                     yaw += new Degree(horzValue * rotationAmount);
                     pitch += new Degree(vertValue * rotationAmount);
                     pitch += new Degree(vertValue * rotationAmount);
@@ -208,7 +201,7 @@ namespace BansheeEditor
                     Quaternion yRot = Quaternion.FromAxisAngle(Vector3.YAxis, yaw);
                     Quaternion yRot = Quaternion.FromAxisAngle(Vector3.YAxis, yaw);
                     Quaternion xRot = Quaternion.FromAxisAngle(Vector3.XAxis, pitch);
                     Quaternion xRot = Quaternion.FromAxisAngle(Vector3.XAxis, pitch);
 
 
-                    Quaternion camRot = yRot*xRot;
+                    Quaternion camRot = yRot * xRot;
                     camRot.Normalize();
                     camRot.Normalize();
 
 
                     SceneObject.Rotation = camRot;
                     SceneObject.Rotation = camRot;
@@ -229,9 +222,9 @@ namespace BansheeEditor
 
 
                         float multiplier = 1.0f;
                         float multiplier = 1.0f;
                         if (fastMove)
                         if (fastMove)
-                            multiplier = FastModeMultiplier;
+                            multiplier = SceneCameraOptions.FastModeMultiplier;
 
 
-                        currentSpeed = MathEx.Clamp(currentSpeed + Acceleration*frameDelta, StartSpeed, TopSpeed);
+                        currentSpeed = MathEx.Clamp(currentSpeed + SceneCameraOptions.Acceleration * frameDelta, SceneCameraOptions.StartSpeed, SceneCameraOptions.TopSpeed);
                         currentSpeed *= multiplier;
                         currentSpeed *= multiplier;
                     }
                     }
                     else
                     else
@@ -242,8 +235,8 @@ namespace BansheeEditor
                     const float tooSmall = 0.0001f;
                     const float tooSmall = 0.0001f;
                     if (currentSpeed > tooSmall)
                     if (currentSpeed > tooSmall)
                     {
                     {
-                        Vector3 velocity = direction*currentSpeed;
-                        SceneObject.Move(velocity*frameDelta);
+                        Vector3 velocity = direction * currentSpeed;
+                        SceneObject.Move(velocity * frameDelta);
                     }
                     }
                 }
                 }
 
 
@@ -256,7 +249,7 @@ namespace BansheeEditor
                     Vector3 direction = new Vector3(horzValue, -vertValue, 0.0f);
                     Vector3 direction = new Vector3(horzValue, -vertValue, 0.0f);
                     direction = camera.SceneObject.Rotation.Rotate(direction);
                     direction = camera.SceneObject.Rotation.Rotate(direction);
 
 
-                    SceneObject.Move(direction*PanSpeed*frameDelta);
+                    SceneObject.Move(direction * SceneCameraOptions.PanSpeed * frameDelta);
                 }
                 }
             }
             }
             else
             else
@@ -281,7 +274,7 @@ namespace BansheeEditor
                     float scrollAmount = VirtualInput.GetAxisValue(scrollAxis);
                     float scrollAmount = VirtualInput.GetAxisValue(scrollAxis);
                     if (!isOrtographic)
                     if (!isOrtographic)
                     {
                     {
-                        SceneObject.Move(SceneObject.Forward*scrollAmount*ScrollSpeed);
+                        SceneObject.Move(SceneObject.Forward * scrollAmount * SceneCameraOptions.ScrollSpeed);
                     }
                     }
                     else
                     else
                     {
                     {
@@ -381,7 +374,7 @@ namespace BansheeEditor
             pitch = (Degree)eulerAngles.x;
             pitch = (Degree)eulerAngles.x;
             yaw = (Degree)eulerAngles.y;
             yaw = (Degree)eulerAngles.y;
 
 
-            Degree FOV = (Degree)(1.0f - animation.State.OrtographicPct)*FieldOfView;
+            Degree FOV = (Degree)(1.0f - animation.State.OrtographicPct) * SceneCameraOptions.FieldOfView;
             if (FOV < (Degree)5.0f)
             if (FOV < (Degree)5.0f)
             {
             {
                 camera.ProjectionType = ProjectionType.Orthographic;
                 camera.ProjectionType = ProjectionType.Orthographic;
@@ -425,7 +418,7 @@ namespace BansheeEditor
         private float CalcDistanceForFrustumWidth(float frustumWidth)
         private float CalcDistanceForFrustumWidth(float frustumWidth)
         {
         {
             if (camera.ProjectionType == ProjectionType.Perspective)
             if (camera.ProjectionType == ProjectionType.Perspective)
-                return (frustumWidth*0.5f)/MathEx.Tan(camera.FieldOfView*0.5f);
+                return (frustumWidth * 0.5f) / MathEx.Tan(camera.FieldOfView * 0.5f);
             else
             else
                 return frustumWidth * 2.0f;
                 return frustumWidth * 2.0f;
         }
         }

+ 99 - 0
Source/Scripting/MBansheeEditor/Windows/Scene/SceneCameraOptions.cs

@@ -0,0 +1,99 @@
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+using BansheeEngine;
+
+namespace BansheeEditor
+{
+    /** @addtogroup Scene-Editor
+     *  @{
+     */
+    /// <summary>
+    /// Options used by the scene camera.
+    /// </summary>
+    internal class SceneCameraOptions
+    {
+        public static float[] ScrollSpeeds
+        {
+            get => new float[]
+            {
+                0.1f,
+                0.25f,
+                0.5f,
+                0.75f,
+                1f,
+                1.5f,
+                2f,
+                3f
+            };
+        }
+
+        public const float StartSpeed = 4.0f;
+        public const float TopSpeed = 12.0f;
+        public readonly Degree FieldOfView = (Degree)90.0f;
+
+        public float Acceleration { get; private set; }
+        public float FastModeMultiplier { get; private set; }
+        public float PanSpeed { get; private set; }
+        public float ScrollSpeed { get; private set; }
+        public float RotationalSpeed { get; private set; }
+
+        public SceneCameraOptions()
+        {
+            Acceleration = EditorSettings.GetFloat("SceneCameraOptions_Acceleration", 1.0f);
+            FastModeMultiplier = EditorSettings.GetFloat("SceneCameraOptions_FastModeMultiplier", 2.0f);
+            PanSpeed = EditorSettings.GetFloat("SceneCameraOptions_PanSpeed", 3.0f);
+            ScrollSpeed = EditorSettings.GetFloat("SceneCameraOptions_ScrollSpeed", 3.0f);
+            RotationalSpeed = EditorSettings.GetFloat("SceneCameraOptions_RotationalSpeed", 3.0f);
+        }
+
+        /// <summary>
+        /// Sets the acceleration of the scene camera
+        /// </summary>
+        /// <param name="acceleration">The acceleration value.</param>
+        public void SetAcceleration(float acceleration)
+        {
+            Acceleration = acceleration;
+            EditorSettings.SetFloat("SceneCameraOptions_Acceleration", acceleration);
+        }
+
+        /// <summary>
+        /// Sets the fast mode multiplier of the scene camera
+        /// </summary>
+        /// <param name="fastModeMultiplier">The fast mode multiplier value.</param>
+        public void SetFastModeMultiplier(float fastModeMultiplier)
+        {
+            FastModeMultiplier = fastModeMultiplier;
+            EditorSettings.SetFloat("SceneCameraOptions_FastModeMultiplier", fastModeMultiplier);
+        }
+
+        /// <summary>
+        /// Sets the pan speed of the scene camera
+        /// </summary>
+        /// <param name="panSpeed">The pan speed value.</param>
+        public void SetPanSpeed(float panSpeed)
+        {
+            PanSpeed = panSpeed;
+            EditorSettings.SetFloat("SceneCameraOptions_PanSpeed", panSpeed);
+        }
+
+        /// <summary>
+        /// Sets the scroll speed of the scene camera
+        /// </summary>
+        /// <param name="scrollSpeed">The scroll speed value.</param>
+        public void SetScrollSpeed(float scrollSpeed)
+        {
+            ScrollSpeed = scrollSpeed;
+            EditorSettings.SetFloat("SceneCameraOptions_ScrollSpeed", scrollSpeed);
+        }
+
+        /// <summary>
+        /// Sets the rotation speed of the scene camera
+        /// </summary>
+        /// <param name="rotationalSpeed">The rotation speed  value.</param>
+        public void SetRotationalSpeed(float rotationalSpeed)
+        {
+            RotationalSpeed = rotationalSpeed;
+            EditorSettings.SetFloat("SceneCameraOptions_RotationalSpeed", rotationalSpeed);
+        }
+    }
+}

+ 59 - 0
Source/Scripting/MBansheeEditor/Windows/Scene/SceneCameraOptionsDropdown.cs

@@ -0,0 +1,59 @@
+//********************************** Banshee Engine (www.banshee3d.com) **************************************************//
+//**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+using BansheeEngine;
+using System.Linq;
+
+namespace BansheeEditor
+{
+    /** @addtogroup Scene-Editor
+     *  @{
+     */
+
+    /// <summary>
+    /// Drop down window that displays options used by the scene camera.
+    /// </summary>
+    [DefaultSize(200, 30)]
+    internal class SceneCameraOptionsDropdown : DropDownWindow
+    {
+
+        private SceneWindow parent;
+
+        private SceneCameraOptions CameraOptions;
+
+        /// <summary>
+        /// Initializes the drop down window by creating the necessary GUI. Must be called after construction and before
+        /// use.
+        /// </summary>
+        /// <param name="parent">Scene window that this drop down window is a part of.</param>
+        /// <param name="cameraOptions">Reference to the current scene camera options.</param>
+        internal void Initialize(SceneWindow parent, SceneCameraOptions cameraOptions)
+        {
+            this.parent = parent;
+            CameraOptions = cameraOptions;
+
+            GUIListBoxField cameraScrollSpeedField = new GUIListBoxField(SceneCameraOptions.ScrollSpeeds.ToList().Select(o => o.ToString()).ToArray(),
+                new LocEdString("Scroll speed"));
+
+            cameraScrollSpeedField.SelectElement(SceneCameraOptions.ScrollSpeeds.ToList().FindIndex(item => item == CameraOptions.ScrollSpeed));
+
+            cameraScrollSpeedField.OnSelectionChanged += OnCameraScrollSpeedChanged;
+
+            GUILayoutY vertLayout = GUI.AddLayoutY();
+            vertLayout.AddFlexibleSpace();
+            GUILayoutX cameraScrollSpeedLayout = vertLayout.AddLayoutX();
+            cameraScrollSpeedLayout.AddFlexibleSpace();
+            cameraScrollSpeedLayout.AddElement(cameraScrollSpeedField);
+            cameraScrollSpeedLayout.AddFlexibleSpace();
+            vertLayout.AddFlexibleSpace();
+        }
+
+        /// <summary>
+        /// Triggered when the scroll speed of the scene camera is changed.
+        /// </summary>
+        /// <param name="index">The index of the selected scroll speed.</param>
+        private void OnCameraScrollSpeedChanged(int index)
+        {
+            CameraOptions.SetScrollSpeed(SceneCameraOptions.ScrollSpeeds[index]);
+        }
+    }
+}

+ 41 - 19
Source/Scripting/MBansheeEditor/Windows/Scene/SceneWindow.cs

@@ -1,9 +1,9 @@
 //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
 //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
 //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
 //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
+using BansheeEngine;
 using System;
 using System;
 using System.Collections.Generic;
 using System.Collections.Generic;
 using System.IO;
 using System.IO;
-using BansheeEngine;
 
 
 namespace BansheeEditor
 namespace BansheeEditor
 {
 {
@@ -60,6 +60,8 @@ namespace BansheeEditor
         private GUIToggle rotateSnapButton;
         private GUIToggle rotateSnapButton;
         private GUIFloatField rotateSnapInput;
         private GUIFloatField rotateSnapInput;
 
 
+        private GUIButton cameraOptionsButton;
+
         private SceneAxesGUI sceneAxesGUI;
         private SceneAxesGUI sceneAxesGUI;
 
 
         private bool hasContentFocus = false;
         private bool hasContentFocus = false;
@@ -183,14 +185,14 @@ namespace BansheeEditor
         {
         {
             mainLayout = GUI.AddLayoutY();
             mainLayout = GUI.AddLayoutY();
 
 
-            GUIContent viewIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.View), 
+            GUIContent viewIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.View),
                 new LocEdString("View"));
                 new LocEdString("View"));
-            GUIContent moveIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Move), 
+            GUIContent moveIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Move),
                 new LocEdString("Move"));
                 new LocEdString("Move"));
-            GUIContent rotateIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Rotate), 
+            GUIContent rotateIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Rotate),
                 new LocEdString("Rotate"));
                 new LocEdString("Rotate"));
             GUIContent scaleIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Scale),
             GUIContent scaleIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Scale),
-                new LocEdString("Scale")); 
+                new LocEdString("Scale"));
 
 
             GUIContent localIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Local),
             GUIContent localIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Local),
                 new LocEdString("Local"));
                 new LocEdString("Local"));
@@ -202,9 +204,9 @@ namespace BansheeEditor
             GUIContent centerIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Center),
             GUIContent centerIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.Center),
                 new LocEdString("Center"));
                 new LocEdString("Center"));
 
 
-            GUIContent moveSnapIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.MoveSnap), 
+            GUIContent moveSnapIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.MoveSnap),
                 new LocEdString("Move snap"));
                 new LocEdString("Move snap"));
-            GUIContent rotateSnapIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.RotateSnap), 
+            GUIContent rotateSnapIcon = new GUIContent(EditorBuiltin.GetSceneWindowIcon(SceneWindowIcon.RotateSnap),
                 new LocEdString("Rotate snap"));
                 new LocEdString("Rotate snap"));
 
 
             GUIToggleGroup handlesTG = new GUIToggleGroup();
             GUIToggleGroup handlesTG = new GUIToggleGroup();
@@ -227,6 +229,9 @@ namespace BansheeEditor
             rotateSnapButton = new GUIToggle(rotateSnapIcon, EditorStyles.Button, GUIOption.FlexibleWidth(35));
             rotateSnapButton = new GUIToggle(rotateSnapIcon, EditorStyles.Button, GUIOption.FlexibleWidth(35));
             rotateSnapInput = new GUIFloatField("", GUIOption.FlexibleWidth(35));
             rotateSnapInput = new GUIFloatField("", GUIOption.FlexibleWidth(35));
 
 
+            GUIContent cameraOptionsIcon = new GUIContent(EditorBuiltin.GetLibraryWindowIcon(LibraryWindowIcon.Options), new LocEdString("Camera options"));
+            cameraOptionsButton = new GUIButton(cameraOptionsIcon);
+
             viewButton.OnClick += () => OnSceneToolButtonClicked(SceneViewTool.View);
             viewButton.OnClick += () => OnSceneToolButtonClicked(SceneViewTool.View);
             moveButton.OnClick += () => OnSceneToolButtonClicked(SceneViewTool.Move);
             moveButton.OnClick += () => OnSceneToolButtonClicked(SceneViewTool.Move);
             rotateButton.OnClick += () => OnSceneToolButtonClicked(SceneViewTool.Rotate);
             rotateButton.OnClick += () => OnSceneToolButtonClicked(SceneViewTool.Rotate);
@@ -243,6 +248,8 @@ namespace BansheeEditor
 
 
             rotateSnapButton.OnToggled += (bool active) => OnRotateSnapToggled(active);
             rotateSnapButton.OnToggled += (bool active) => OnRotateSnapToggled(active);
             rotateSnapInput.OnChanged += (float value) => OnRotateSnapValueChanged(value);
             rotateSnapInput.OnChanged += (float value) => OnRotateSnapValueChanged(value);
+            
+            cameraOptionsButton.OnClick += () => OnCameraOptionsClicked();
 
 
             GUILayout handlesLayout = mainLayout.AddLayoutX();
             GUILayout handlesLayout = mainLayout.AddLayoutX();
             handlesLayout.AddElement(viewButton);
             handlesLayout.AddElement(viewButton);
@@ -261,6 +268,8 @@ namespace BansheeEditor
             handlesLayout.AddSpace(10);
             handlesLayout.AddSpace(10);
             handlesLayout.AddElement(rotateSnapButton);
             handlesLayout.AddElement(rotateSnapButton);
             handlesLayout.AddElement(rotateSnapInput);
             handlesLayout.AddElement(rotateSnapInput);
+            handlesLayout.AddSpace(10);
+            handlesLayout.AddElement(cameraOptionsButton);
 
 
             GUIPanel mainPanel = mainLayout.AddPanel();
             GUIPanel mainPanel = mainLayout.AddPanel();
             rtPanel = mainPanel.AddPanel();
             rtPanel = mainPanel.AddPanel();
@@ -286,6 +295,19 @@ namespace BansheeEditor
             UpdateRenderTexture(Width, Height - HeaderHeight);
             UpdateRenderTexture(Width, Height - HeaderHeight);
         }
         }
 
 
+        private void OnCameraOptionsClicked()
+        {
+            Vector2I openPosition;
+            Rect2I buttonBounds = GUIUtility.CalculateBounds(cameraOptionsButton, GUI);
+
+            openPosition.x = buttonBounds.x + buttonBounds.width / 2;
+            openPosition.y = buttonBounds.y + buttonBounds.height / 2;
+
+            SceneCameraOptionsDropdown cameraOptionsDropdown = DropDownWindow.Open<SceneCameraOptionsDropdown>(GUI, openPosition);
+
+            cameraOptionsDropdown.Initialize(this, cameraController.SceneCameraOptions);
+        }
+
         private void OnDestroy()
         private void OnDestroy()
         {
         {
             if (camera != null)
             if (camera != null)
@@ -429,7 +451,7 @@ namespace BansheeEditor
                 }
                 }
             }
             }
         }
         }
-        
+
         /// <summary>
         /// <summary>
         /// Converts screen coordinates into coordinates relative to the scene view render texture.
         /// Converts screen coordinates into coordinates relative to the scene view render texture.
         /// </summary>
         /// </summary>
@@ -463,13 +485,13 @@ namespace BansheeEditor
                         DuplicateSelection();
                         DuplicateSelection();
                     else if (VirtualInput.IsButtonDown(EditorApplication.DeleteKey))
                     else if (VirtualInput.IsButtonDown(EditorApplication.DeleteKey))
                         DeleteSelection();
                         DeleteSelection();
-                    else if(VirtualInput.IsButtonDown(viewToolKey))
+                    else if (VirtualInput.IsButtonDown(viewToolKey))
                         EditorApplication.ActiveSceneTool = SceneViewTool.View;
                         EditorApplication.ActiveSceneTool = SceneViewTool.View;
-                    else if(VirtualInput.IsButtonDown(moveToolKey))
+                    else if (VirtualInput.IsButtonDown(moveToolKey))
                         EditorApplication.ActiveSceneTool = SceneViewTool.Move;
                         EditorApplication.ActiveSceneTool = SceneViewTool.Move;
-                    else if(VirtualInput.IsButtonDown(rotateToolKey))
+                    else if (VirtualInput.IsButtonDown(rotateToolKey))
                         EditorApplication.ActiveSceneTool = SceneViewTool.Rotate;
                         EditorApplication.ActiveSceneTool = SceneViewTool.Rotate;
-                    else if(VirtualInput.IsButtonDown(scaleToolKey))
+                    else if (VirtualInput.IsButtonDown(scaleToolKey))
                         EditorApplication.ActiveSceneTool = SceneViewTool.Scale;
                         EditorApplication.ActiveSceneTool = SceneViewTool.Scale;
                 }
                 }
             }
             }
@@ -497,7 +519,7 @@ namespace BansheeEditor
 
 
                 if (sceneAxesGUI.IsActive())
                 if (sceneAxesGUI.IsActive())
                     sceneAxesGUI.ClearSelection();
                     sceneAxesGUI.ClearSelection();
-            } 
+            }
             else if (Input.IsPointerButtonDown(PointerButton.Left))
             else if (Input.IsPointerButtonDown(PointerButton.Left))
             {
             {
                 mouseDownPosition = scenePos;
                 mouseDownPosition = scenePos;
@@ -516,7 +538,7 @@ namespace BansheeEditor
                         Selection.SceneObject = draggedSO;
                         Selection.SceneObject = draggedSO;
                         EditorApplication.SetSceneDirty();
                         EditorApplication.SetSceneDirty();
                     }
                     }
-                    
+
                     draggedSO = null;
                     draggedSO = null;
                 }
                 }
                 else
                 else
@@ -579,7 +601,7 @@ namespace BansheeEditor
                         if (Input.IsButtonHeld(ButtonCode.Space))
                         if (Input.IsButtonHeld(ButtonCode.Space))
                         {
                         {
                             SnapData snapData;
                             SnapData snapData;
-                            sceneSelection.Snap(scenePos, out snapData, new SceneObject[] {draggedSO});
+                            sceneSelection.Snap(scenePos, out snapData, new SceneObject[] { draggedSO });
 
 
                             Quaternion q = Quaternion.FromToRotation(Vector3.YAxis, snapData.normal);
                             Quaternion q = Quaternion.FromToRotation(Vector3.YAxis, snapData.normal);
                             draggedSO.Position = snapData.position;
                             draggedSO.Position = snapData.position;
@@ -617,7 +639,7 @@ namespace BansheeEditor
                 {
                 {
                     if (Input.IsPointerButtonDown(PointerButton.Left))
                     if (Input.IsPointerButtonDown(PointerButton.Left))
                     {
                     {
-                        Rect2I sceneAxesGUIBounds = new Rect2I(Width - HandleAxesGUISize - HandleAxesGUIPaddingX, 
+                        Rect2I sceneAxesGUIBounds = new Rect2I(Width - HandleAxesGUISize - HandleAxesGUIPaddingX,
                             HandleAxesGUIPaddingY, HandleAxesGUISize, HandleAxesGUISize);
                             HandleAxesGUIPaddingY, HandleAxesGUISize, HandleAxesGUISize);
 
 
                         if (sceneAxesGUIBounds.Contains(scenePos))
                         if (sceneAxesGUIBounds.Contains(scenePos))
@@ -640,14 +662,14 @@ namespace BansheeEditor
                             bool ctrlHeld = Input.IsButtonHeld(ButtonCode.LeftControl) ||
                             bool ctrlHeld = Input.IsButtonHeld(ButtonCode.LeftControl) ||
                                             Input.IsButtonHeld(ButtonCode.RightControl);
                                             Input.IsButtonHeld(ButtonCode.RightControl);
 
 
-                            sceneSelection.PickObject(scenePos, ctrlHeld, new SceneObject[] {draggedSO});
+                            sceneSelection.PickObject(scenePos, ctrlHeld, new SceneObject[] { draggedSO });
                         }
                         }
                     }
                     }
                 }
                 }
             }
             }
             else
             else
                 cameraController.EnableInput(false);
                 cameraController.EnableInput(false);
-            
+
             SceneHandles.BeginInput();
             SceneHandles.BeginInput();
             sceneHandles.UpdateInput(scenePos, Input.PointerDelta);
             sceneHandles.UpdateInput(scenePos, Input.PointerDelta);
             sceneAxesGUI.UpdateInput(scenePos);
             sceneAxesGUI.UpdateInput(scenePos);
@@ -933,7 +955,7 @@ namespace BansheeEditor
                 dragSelection = new GUITexture(null, true, EditorStylesInternal.SelectionArea);
                 dragSelection = new GUITexture(null, true, EditorStylesInternal.SelectionArea);
                 selectionPanel.AddElement(dragSelection);
                 selectionPanel.AddElement(dragSelection);
             }
             }
-            
+
             dragSelectionEnd = scenePos;
             dragSelectionEnd = scenePos;
 
 
             Rect2I selectionArea = new Rect2I();
             Rect2I selectionArea = new Rect2I();