31-05-2021, 07:45 AM
(This post was last modified: 31-05-2021, 07:46 AM by josemendez.)
(31-05-2021, 06:53 AM)Hakazaba Wrote: Im sorry to ask for this, but im not very familiar with events. How would i write a subscription to that event which triggers a function?
Code:
//somewhere in your code (Start, Awake, OnEnable...) you subscribe to OnCollision:
solver.OnCollision += MyMethod;
//somewhere else (OnDisable, OnDestroy...), you unsubscribe:
solver.OnCollision -= MyMethod;
// the method being subscribed:
void MyMethod (object sender, Obi.ObiSolver.ObiCollisionEventArgs e)
{
}
See:
https://docs.microsoft.com/en-us/dotnet/...rom-events