| 123456789101112131415161718192021222324252627282930313233343536 |
- using GadgetCore.API;
- using HarmonyLib;
- using UnityEngine;
- namespace ScreenshotMode.Patches
- {
- [HarmonyPatch(typeof(GameScript))]
- [HarmonyPatch("Update")]
- [HarmonyGadget("ScreenshotMode")]
- public static class Patch_GameScript_Update
- {
- [HarmonyPostfix]
- public static void Postfix(GameScript __instance)
- {
- if (MenuScript.player && GameScript.pausing && Input.GetMouseButtonDown(0))
- {
- RaycastHit hit;
- var ray = Camera.main.ScreenPointToRay(Input.mousePosition);
- if (Physics.Raycast(ray, out hit, 5f))
- {
- string name = hit.transform.gameObject.name;
- switch (name)
- {
- case "bScreenshotMode":
- __instance.GetComponent<AudioSource>().PlayOneShot((AudioClip)Resources.Load("Au/bHit"), Menuu.soundLevel / 10f);
- Core.state = (Core.state + 1) % 3;
- ScreenshotMode.Update();
- break;
- }
- }
- }
- }
- }
- }
|