public static bool Prefix(Timelapser __instance, RenderTexture renderTex) { if (__instance == CustomTilapser.timelapser) { CustomTilapser.CustomWriteToPng(renderTex); return(false); } return(true); }
public static void Postfix(PauseScreen __instance) { var instance = Traverse.Create(__instance); var buttons = instance.Field("buttons").GetValue <KButtonMenu.ButtonInfo[]>(); var buttonsList = buttons.ToList(); Instance = __instance; buttonsList.Insert(buttonsList.Count - 2, new KButtonMenu.ButtonInfo("Take a HD Screenshot", Action.NumActions, () => { CustomTilapser.CreateScreen(Instance); })); instance.Field("buttons").SetValue(buttonsList.ToArray()); }