You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.4 KiB

  1. using System;
  2. using IPA;
  3. using IPA.Logging;
  4. using IPA.Config;
  5. using IPA.Config.Stores;
  6. namespace Demo
  7. {
  8. /*
  9. [Plugin(RuntimeOptions.DynamicInit)]
  10. */
  11. [Plugin(RuntimeOptions.SingleStartInit)]
  12. internal class Plugin
  13. {
  14. public static Logger log { get; private set; }
  15. [Init]
  16. public Plugin(Logger logger, Config conf)
  17. {
  18. log = logger;
  19. PluginConfig.Instance = conf.Generated<PluginConfig>();
  20. log.Debug("Config loaded");
  21. // setup that does not require game code
  22. // this is only called once ever, so do once-ever initialization
  23. }
  24. /*
  25. [Init]
  26. public Plugin(Logger logger)
  27. {
  28. log = logger;
  29. log.Debug("Basic plugin running!");
  30. // setup that does not require game code
  31. // this is only called once ever, so do once-ever initialization
  32. }
  33. */
  34. /*
  35. [OnEnable]
  36. public void OnEnable()
  37. */
  38. [OnStart]
  39. public void OnStart()
  40. {
  41. // setup that requires game code
  42. }
  43. /*
  44. [OnDisable]
  45. public void OnDisable()
  46. */
  47. [OnExit]
  48. public void OnExit()
  49. {
  50. // teardown
  51. // this may be called mid-game if you are using RuntimeOptions.DynamicInit
  52. }
  53. }
  54. }