A Unity runtime inspection plugin for fun
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

65 satır
1.6KB

  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; } = "A";
  14. public string HarmonyID { get; } = "org.git.exmods.modtainers.dissonance";
  15. public void OnApplicationQuit()
  16. {
  17. harmony.UnpatchAll(HarmonyID);
  18. Inspector.ObjectInspector.LogAll();
  19. Debug.Log(Name + " shutdown complete");
  20. }
  21. public void OnApplicationStart()
  22. {
  23. if (harmony == null)
  24. {
  25. harmony = HarmonyInstance.Create(HarmonyID);
  26. harmony.PatchAll(Assembly.GetExecutingAssembly());
  27. }
  28. Inspector.ObjectInspector.LogAll();
  29. Debug.Log(Name + " start & patch complete");
  30. }
  31. public void OnFixedUpdate()
  32. {
  33. //throw new NotImplementedException();
  34. }
  35. public void OnLateUpdate()
  36. {
  37. //throw new NotImplementedException();
  38. }
  39. public void OnLevelWasInitialized(int level)
  40. {
  41. //throw new NotImplementedException();
  42. }
  43. public void OnLevelWasLoaded(int level)
  44. {
  45. //throw new NotImplementedException();
  46. }
  47. public void OnUpdate()
  48. {
  49. //throw new NotImplementedException();
  50. }
  51. }
  52. }