So, I have an event called CalculateNewHeight
, which I've attached to an action
called OnHeightDataLoaded
:
renderer.OnHeightDataLoaded += ((heightData) => CalculateNewHeight(heightData, instance));
...but ideally at this point in the code it'd return a value, rather than just call another function, for example:
int newData = renderer.OnHeightDataLoaded += ((heightData) => CalculateNewHeight(heightData, instance));
Obviously that code's wrong, but you get what I mean. Using the event more like async await
. Is that possible?
Haha, I'm quite new to C#, so don't hesitate to let me know if I'm going about this all wrong.