From 9d860026217d380937bf461a1b6343e022604a94 Mon Sep 17 00:00:00 2001 From: Will <125041335+will258012@users.noreply.github.com> Date: Sat, 14 Dec 2024 15:32:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=98=B2=E6=AD=A2Update()=E5=9C=A8=E7=A6=81?= =?UTF-8?q?=E7=94=A8=E6=91=84=E5=83=8F=E6=9C=BA=E6=97=B6=E8=A7=A6=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FPSCamera/Code/Cam/Controller/FPSCamController.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/FPSCamera/Code/Cam/Controller/FPSCamController.cs b/FPSCamera/Code/Cam/Controller/FPSCamController.cs index f4480ac..bc2d415 100644 --- a/FPSCamera/Code/Cam/Controller/FPSCamController.cs +++ b/FPSCamera/Code/Cam/Controller/FPSCamController.cs @@ -69,6 +69,7 @@ public void EnableCam(bool IsPlugin = false) private void DisableCam() { Logging.KeyMessage("Disabling FPS Camera"); + Status = CamStatus.Disabling; FPSCam?.DisableCam(); FPSCam = null; if (ModSettings.ShowInfoPanel) @@ -179,14 +180,17 @@ private void Update() } catch (Exception e) { + if (Status == CamStatus.Enabled || Status == CamStatus.PluginEnabled) + { + Logging.Error("FPS Camera is about to exit due to some issues (Update)"); + DisableCam(); + } + var notification = NotificationBase.ShowNotification(); notification.AddParas(Translations.Translate("ERROR")); notification.AddSpacer(); notification.AddParas(e.ToString()); - - Logging.Error(); - Logging.LogException(e, "FPS Camera is about to exit due to some issues (Update)"); - DisableCam(); + Logging.LogException(e); } } @@ -515,7 +519,8 @@ public enum CamStatus Disabled, Enabled, PluginEnabled, - Transitioning + Transitioning, + Disabling } private static Transform CameraTransform => GameCamController.Instance.MainCamera.transform; private bool _isScrollTransitioning = false;