Simple question that google isn't answering for me... is the following bad?
Explanation:
I need to apply an acceleration to an object for a certain time interval. I do so by having the object subscribe to an event that fires just before the physics simulation performs a time step. When the acceleration is complete, it unsubscribes from the event, but it also needs to unsubscribe in the event that the object's Dipose() is called while the acceleration is in progress, but that means it unsubscribes twice.
Code:
MySystem.MyEvent += MyHandler;
// later...
MySystem.MyEvent -= MyHandler;
// later...
MySystem.MyEvent -= MyHandler;
Explanation:
I need to apply an acceleration to an object for a certain time interval. I do so by having the object subscribe to an event that fires just before the physics simulation performs a time step. When the acceleration is complete, it unsubscribes from the event, but it also needs to unsubscribe in the event that the object's Dipose() is called while the acceleration is in progress, but that means it unsubscribes twice.