public delegate void HandworkAction();
public event HandworkAction grab;
After deactivating the object that contains the script, and reactivating it again, events become null, causing nullreference exception. Is this by any change a bug, why does this happen and what do you recommend me to do?
I am not an event guru , but that’s how I would do it :
Subscribe to event during OnEnable().
Unsubscribe from event during OnDisable().
before invoking event check if it has subscribers.
Or use UnityEvent rather than a normal event, which should be easier and much more bug free.
Also I would define events as public static in a class made specifically for it.