コード例 #1
0
 /// <summary>
 /// Called when BSEvents.menuSceneLoadedFresh is triggered. UI creation is in here instead of
 /// OnSceneLoaded because some settings won't work otherwise.
 /// </summary>
 public static void MenuLoadedFresh()
 {
     try
     {
         config.ResetConfigChanged();
         config.FillDefaults();
         var settingsMenu = GameObject.FindObjectOfType <SettingsFlowCoordinator>();
         try
         {
             settingsMenu.didFinishEvent -= SettingsMenu_didFinishEvent;
             settingsMenu.didFinishEvent += SettingsMenu_didFinishEvent;
         }
         catch (Exception)
         {
             Plugin.log?.Critical("Could not find the SettingsFlowCoordinator. BeatSync settings will not be able to save.");
         }
     }
     catch (Exception ex)
     {
         Plugin.log?.Error(ex);
     }
 }