コード例 #1
0
            static void Prefix(Smelter __instance)
            {
                SurtlingCoreOverclocking surtlingCoreOverclocking = __instance.GetComponentInParent <SurtlingCoreOverclocking>();

                if (surtlingCoreOverclocking == null)
                {
                    logger.LogInfo("Adding SurtlingCoreOverclocking Component to smelter");
                    __instance.gameObject.AddComponent <SurtlingCoreOverclocking>();
                }
            }
コード例 #2
0
            static void Prefix(Smelter __instance, ref float fuel)
            {
                SurtlingCoreOverclocking surtlingCoreOverclocking = __instance.GetComponentInParent <SurtlingCoreOverclocking>();

                if (surtlingCoreOverclocking)
                {
                    fuel = surtlingCoreOverclocking.OnSetFuel(fuel);
                }
                else
                {
                    logger.LogWarning("No SurtlingCoreOverclocking component on smelter " + __instance.transform.position);
                }
            }
コード例 #3
0
            static void Postfix(Smelter __instance, float __result)
            {
                SurtlingCoreOverclocking surtlingCoreOverclocking = __instance.GetComponentInParent <SurtlingCoreOverclocking>();

                if (surtlingCoreOverclocking)
                {
                    surtlingCoreOverclocking.OnGetFuel(__result);
                }
                else
                {
                    logger.LogWarning("No SurtlingCoreOverclocking component on smelter " + __instance.transform.position);
                }
            }
コード例 #4
0
            static void Prefix(Smelter __instance, string ore, ref int stack)
            {
                SurtlingCoreOverclocking surtlingCoreOverclocking = __instance.GetComponentInParent <SurtlingCoreOverclocking>();

                if (surtlingCoreOverclocking)
                {
                    int aditional = surtlingCoreOverclocking.OnSpawn(ore);
                    stack += aditional;
                }
                else
                {
                    logger.LogWarning("No SurtlingCoreOverclocking component on smelter " + __instance.transform.position);
                }
            }