1
0
mirror of https://github.com/originalnicodr/CinematicUnityExplorer.git synced 2025-07-18 17:38:01 +08:00

Fixed bug when disabling orthographic property on freecam

This commit is contained in:
originalnicodr
2025-02-02 18:42:30 -03:00
parent e7d591176e
commit 4c100daf83

View File

@ -345,13 +345,19 @@ namespace UnityExplorer.UI.Panels
}
static void MaybeToggleOrthographic(bool enable){
// If we want to enable orthographic view but never disabled it don't do anything
if (enable && !disabledOrthographic)
return;
if (ourCamera){
ourCamera.orthographic = enable;
disabledOrthographic = !enable;
if (ourCamera) {
if (enable) {
// Only re-enable orthographic mode if we previously disabled it
if (disabledOrthographic) {
ourCamera.orthographic = true;
disabledOrthographic = false;
}
} else {
if (ourCamera.orthographic) {
disabledOrthographic = true;
ourCamera.orthographic = false;
}
}
}
}