A Unity runtime inspection plugin for fun
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

63 lignes
1.5KB

  1. using System;
  2. using IllusionPlugin;
  3. using UnityEngine;
  4. using Harmony;
  5. using System.Reflection;
  6. namespace Dissonance
  7. {
  8. public class DissonancePlugin : IllusionPlugin.IEnhancedPlugin
  9. {
  10. public static HarmonyInstance 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 = HarmonyInstance.Create(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. }