From d6f2e95423af1179b1cfa7cb6bc8e86b437caa9c Mon Sep 17 00:00:00 2001 From: Sorra Date: Mon, 10 Jan 2022 22:09:30 -0800 Subject: [PATCH] Skip fly when in 2D Scene View 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 #30 --- Editor/ViewportController.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Editor/ViewportController.cs b/Editor/ViewportController.cs index bc0c24b..4cf0e0b 100644 --- a/Editor/ViewportController.cs +++ b/Editor/ViewportController.cs @@ -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. @@ -433,4 +435,4 @@ private static Vector3 SnapOnTranslation(Vector3 v, float snap) #endregion - Snapping - } } -#endif \ No newline at end of file +#endif