Class InvokeOnReloadAttribute
- Namespace
- GrindFest
- Assembly
- GrindFest.dll
Marks a static method to be automatically called when your bot script is recompiled. This is useful for destroying instantiated classes of your types that will stop being valid (mono behaviours are destroyed automatically) or storing state before your bot code is reloaded.
[AttributeUsage(AttributeTargets.Method)]
public class InvokeOnReloadAttribute : Attribute
- Inheritance
-
objectInvokeOnReloadAttribute
- Inherited Members
Remarks
This attribute can only be applied to static methods. When your script is recompiled
(which happens automatically when you save your script file), all methods marked with
this attribute will be called before the old script is unloaded.
public class MyBot : AutomaticHero
{
[InvokeOnReload]
private static void OnReload()
{
Debug.Log("MyBot is being reloaded!");
}
}