A Unity runtime inspection plugin for fun
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

63 rindas
1.5KB

  1. using System;
  2. using IllusionPlugin;
  3. using UnityEngine;
  4. using HarmonyLib;
  5. using System.Reflection;
  6. namespace Dissonance
  7. {
  8. public class DissonancePlugin : IllusionPlugin.IEnhancedPlugin
  9. {
  10. public static Harmony harmony { get; protected set; }
  11. public string[] Filter { get; } = new string[] { "Gamecraft" };
  12. public string Name { get; } = "Dissonance";
  13. public string Version { get; } = "B";
  14. public string HarmonyID { get; } = "org.git.exmods.modtainers.dissonance";
  15. public void OnApplicationQuit()
  16. {
  17. harmony.UnpatchAll(HarmonyID); // likely unnecessary
  18. Debug.Log(Name + " shutdown complete");
  19. }
  20. public void OnApplicationStart()
  21. {
  22. if (harmony == null)
  23. {
  24. harmony = new Harmony(HarmonyID);
  25. harmony.PatchAll(Assembly.GetExecutingAssembly());
  26. }
  27. Debug.Log(Name + " start & patch complete");
  28. }
  29. public void OnFixedUpdate()
  30. {
  31. //throw new NotImplementedException();
  32. }
  33. public void OnLateUpdate()
  34. {
  35. //throw new NotImplementedException();
  36. }
  37. public void OnLevelWasInitialized(int level)
  38. {
  39. //throw new NotImplementedException();
  40. }
  41. public void OnLevelWasLoaded(int level)
  42. {
  43. //throw new NotImplementedException();
  44. }
  45. public void OnUpdate()
  46. {
  47. //throw new NotImplementedException();
  48. }
  49. }
  50. }