-
Notifications
You must be signed in to change notification settings - Fork 34
Using C# Events (P1)
ced777ric edited this page Feb 10, 2025
·
1 revision
All your event subscriptions should be done when your plugin is enabled.
public override void Enable()
{
ServerEvents.WaveRespawned += OnWaveRespawned
}At the same time, all your event unsubscriptions should be done when your plugin is being disabled.
Unsubscriptions are useful to avoid memory leaks and will ensure that once your plugin is disabled the event won't be called anymore.
public override void Disable()
{
ServerEvents.WaveRespawned -= OnWaveRespawned;
}- Making Plugins
- Features
- Guides