コード例 #1
0
ファイル: Main.cs プロジェクト: seraphimrisen/SubnauticaMods
        public static void Patch()
        {
            SeraLogger.PatchStart(modName, "1.0.0");
            try
            {
                var harmony = new Harmony("seraphimrisen.biochemicalbattery.mod");

                BioPlasmaItems.PatchBioPlasmaItems();

                // First, you instantiate PrimeSonic's service class
                var cbservice = new CustomBatteriesService();
                // Create a new instance for your custom pack
                var bcpack = new Items.BiochemicalPack();
                // Use CustomBatteries' API to add it to the game
                cbservice.AddPluginPackFromMod(bcpack);


                harmony.PatchAll(Assembly.GetExecutingAssembly());

                SeraLogger.PatchComplete(modName);
            }
            catch (Exception ex)
            {
                SeraLogger.PatchFailed(modName, ex);
            }
        }
コード例 #2
0
        public static void Patch()
        {
            // Step 1 - Instantiate the service class
            var service = new CustomBatteriesService();

            // Step 2 - Get your plugin pack intance
            var myPack = new MyPack();

            // Step 3 - Call the AddPluginPackFromMod method with your plugin pack
            service.AddPluginPackFromMod(myPack);

            // Do whatever other patching your mod requires
        }
コード例 #3
0
        public static void Patch()
        {
            // Step 1 - Instantiate the service class
            var cbService = new CustomBatteriesService();

            // Step 2 - Get your plugin pack instance
            var myPlugin = new MyPlugin();

            // Step 3 - Call the AddPluginPackFromMod method with your plugin pack
            CustomPack myPack = cbService.AddPluginPackFromMod(myPlugin);

            // It will return a CustomPack that has everything you might need to continue patching.
            // The ModPrefabs CustomBattery and CustomPowerCell are already patched.
            TechType myBattery   = myPack.CustomBattery.TechType;
            TechType myPowercell = myPack.CustomPowerCell.TechType;

            // Do whatever other patching your mod requires
        }