Skip to content

Commit

Permalink
Skip fly when in 2D Scene View
Browse files Browse the repository at this point in the history
When in 2D scene view to edit a UI a warning is thrown. I have no idea if this is the best way to fix it, but it works and flying makes no sense in 2D so it works for me.

Fixes PatHightree#30
  • Loading branch information
SorraTheOrc authored Jan 11, 2022
1 parent 2cd5a7c commit d6f2e95
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Editor/ViewportController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ static void Fly(SceneView sceneView)

static void Fly(SceneView sceneView, Vector3 translationInversion, Vector3 rotationInversion)
{
if (sceneView.in2DMode) return;

SyncRigWithScene();

// Apply inversion of axes for fly/grabmove mode.
Expand Down Expand Up @@ -433,4 +435,4 @@ private static Vector3 SnapOnTranslation(Vector3 v, float snap)
#endregion - Snapping -
}
}
#endif
#endif

0 comments on commit d6f2e95

Please sign in to comment.