public void OnDestroy() { CmZConfig.WriteConfig(); commands = null; toggleCommands = null; daynightTab = null; categoriesTab = null; vehicleSettings = null; tMatrix = null; initToggleButtons = false; warpSound = null; isActive = false; onConsoleCommandEntered.RemoveHandler(this, OnConsoleCommandEntered); onFilterFastChanged.RemoveHandler(this, OnFilterFastChanged); }
public static void Load() { try { CmZConfig.InitConfig(); Assembly assembly = Assembly.GetExecutingAssembly(); Harmony.CreateAndPatchAll(assembly, $"BelowZero.{assembly.GetName().Name}.mod"); SceneManager.sceneLoaded += new UnityAction <Scene, LoadSceneMode>(OnSceneLoaded); } catch (Exception ex) { Debug.LogException(ex); } }