I'm using the Kinect v2 with Unity3D. A class BodyFramReader has an event Framearrived that I wish to subscribe to. Heres my code so far..
void Start()
{
man.kman._BodyReader.FrameArrived += this.FrameIn;
}
void FrameIn(BodyFrameReader sender, BodyFrameArrivedEventArgs a)
{
// Do something useful here.
}
I get the following error in visual studio. It seems my delegate method is not right. If that is the problem how do I find the right parameters? If not, what am I doing wrong?
Your sender
parameter doesn't match the parameter in EventHandler<TEventArgs>
- it should be of type object
:
void FrameIn(object sender, BodyFrameArrivedEventArgs e)
If you need the sender as a BodyFrameReader
, you can cast to it within the method.
See more on this question at Stackoverflow