示例#1
0
        public static void Load()
        {
            try
            {
                isAssetsLoaded = LoadAssets();

                CannonConfig.LoadConfig();

                var laserCannon = new CannonPrefab();

                laserCannon.Patch();

                techTypeID = laserCannon.TechType;

                HarmonyInstance.Create("Subnautica.CyclopsLaserCannonModule.mod").PatchAll(Assembly.GetExecutingAssembly());

                SceneManager.sceneLoaded += new UnityAction <Scene, LoadSceneMode>(OnSceneLoaded);

                RegisterUpgrade();
            }
            catch (Exception ex)
            {
                Debug.LogException(ex);
            }
        }
        private void SFXVolumeChanged(object sender, SliderChangedEventArgs args)
        {
            if (args.Id != CannonConfig.SECTION_PROGRAM[3])
            {
                return;
            }

            CannonConfig.program_settings["SFX_Volume"] = args.Value.ToString();
            CannonConfig.WriteConfig();

            Main.onConfigurationChanged.Trigger("SFX_Volume");
        }
        private void HostileOnly(object sender, ToggleChangedEventArgs args)
        {
            if (args.Id != CannonConfig.SECTION_PROGRAM[0])
            {
                return;
            }

            CannonConfig.program_settings["OnlyHostile"] = args.Value.ToString();
            CannonConfig.WriteConfig();

            Main.onConfigurationChanged.Trigger("OnlyHostile");
        }