Skip to content

Instantly share code, notes, and snippets.

View machinaeXphilip's full-sized avatar
🦕

machinaeXphilip machinaeXphilip

🦕
  • Berlin, Germany
View GitHub Profile
@machinaeXphilip
machinaeXphilip / SceneViewZAlign.cs
Created July 25, 2023 16:44 — forked from FreyaHolmer/SceneViewZAlign.cs
Allows the scene view camera to use Z up/down (be sure to place this script in an Editor/ folder)
// Allows you to change the up vector in the scene view to the Z axis.
// Y-up mode uses Unity's default implementation.
//
// Original code from Akulist on the Unity forums, modified by Freya Holmér:
// • Fixed orbit+RMB zoom not working
// • Toggling will now align the camera immediately to the new up vector
// • When the camera is upside down in Z axis mode, left/right orbit will no longer be mirrored (pls fix this too Unity~)
// • Moved toggle buttons to under the gizmo
// • Fixed broken rotation state when focusing a different window in Unity and coming back to the scene view
//