@@ -350,18 +350,18 @@ static void SetupFreeCamera()
350350 if ( ! cameraPathMover )
351351 cameraPathMover = ourCamera . gameObject . AddComponent < CatmullRom . CatmullRomMover > ( ) ;
352352
353+ string currentScene = SceneManager . GetActiveScene ( ) . name ;
354+ if ( ConfigManager . Reset_Camera_Transform . Value || lastScene != currentScene ) {
355+ ResetCameraTransform ( ) ;
356+ }
357+ lastScene = currentScene ;
358+
353359 GetFreecam ( ) . transform . position = ( Vector3 ) currentUserCameraPosition ;
354360 GetFreecam ( ) . transform . rotation = ( Quaternion ) currentUserCameraRotation ;
355361 SetFOV ( currentUserCameraFov ) ;
356362
357363 ourCamera . gameObject . SetActive ( true ) ;
358364 ourCamera . enabled = true ;
359-
360- string currentScene = SceneManager . GetActiveScene ( ) . name ;
361- if ( lastScene != currentScene || ConfigManager . Reset_Camera_Transform . Value ) {
362- OnResetPosButtonClicked ( ) ;
363- }
364- lastScene = currentScene ;
365365 }
366366
367367 internal static void EndFreecam ( )
@@ -916,19 +916,25 @@ void OnUseGameCameraToggled(bool value)
916916 BeginFreecam ( ) ;
917917 }
918918
919- static void OnResetPosButtonClicked ( )
919+ static void ResetCameraTransform ( )
920920 {
921921 currentUserCameraPosition = originalCameraPosition ;
922922 currentUserCameraRotation = originalCameraRotation ;
923+ currentUserCameraFov = originalCameraFOV ;
923924
925+ SetCameraPosition ( ( Vector3 ) currentUserCameraPosition , true ) ;
926+ SetCameraRotation ( ( Quaternion ) currentUserCameraRotation , true ) ;
927+ ourCamera . fieldOfView = originalCameraFOV ;
928+
929+ positionInput . Text = ParseUtility . ToStringForInput < Vector3 > ( originalCameraPosition ) ;
930+ }
931+
932+ static void OnResetPosButtonClicked ( )
933+ {
924934 if ( inFreeCamMode && ourCamera )
925935 {
926- SetCameraPosition ( ( Vector3 ) currentUserCameraPosition , true ) ;
927- SetCameraRotation ( ( Quaternion ) currentUserCameraRotation , true ) ;
928- ourCamera . fieldOfView = originalCameraFOV ;
936+ ResetCameraTransform ( ) ;
929937 }
930-
931- positionInput . Text = ParseUtility . ToStringForInput < Vector3 > ( originalCameraPosition ) ;
932938 }
933939
934940 void PositionInput_OnEndEdit ( string input )
0 commit comments