private static void DestroyMe3_Prefix(ObjectReal __instance) { if (__instance is Stove stove) { StoveController.TriggerExplosion(stove); } }
private static void DestroyMe_Prefix(PlayfieldObject damagerObject, ObjectReal __instance) { logger.LogDebug($"{__instance.name}: {MethodBase.GetCurrentMethod().Name}"); if (__instance is Stove stove) { StoveController.RegisterDamagedBy(stove, damagerObject); } }
private static void DetermineButtons_Postfix(ObjectReal __instance) { switch (__instance) { case FlamingBarrel barrel: FlamingBarrelController.AddButtons(barrel); break; case Stove stove: StoveController.AddButtons(stove); break; case TrashCan trashCan: // TODO if I ended up creating a TrashCanController class, move this there instead trashCan.AddButton(text: cButtonText.HideInContainer); trashCan.AddButton(text: cButtonText.OpenContainer); break; case VendorCart vendorCart: // TODO if I ended up creating a VendorCartController class, move this there instead vendorCart.AddButton(text: cButtonText.StealItem); break; } }
private void Start() { stove = GetComponentInParent <StoveController>(); }