InvokeOnHotReloadLocal.cs 865 B

12345678910111213141516171819202122
  1. using System;
  2. namespace SingularityGroup.HotReload {
  3. /// <summary>
  4. /// Method with this attribute will get invoked when it gets patched
  5. /// </summary>
  6. /// <remarks>
  7. /// The method with this attribute needs to have no parameters.
  8. /// Furthermore it needs to either be static or an instance method inside a <see cref="UnityEngine.MonoBehaviour"/>.
  9. /// For the latter case the method of all instances of the <see cref="UnityEngine.MonoBehaviour"/> will be called.
  10. /// In case the method has a return value it will be ignored.
  11. /// </remarks>
  12. [AttributeUsage(AttributeTargets.Method)]
  13. public class InvokeOnHotReloadLocal : Attribute {
  14. public readonly string methodToInvoke;
  15. public InvokeOnHotReloadLocal(string methodToInvoke = null) {
  16. this.methodToInvoke = methodToInvoke;
  17. }
  18. }
  19. }