CubeGestureListener.UserDetected C# (CSharp) Method

UserDetected() public method

Invoked when a new user is detected. Here you can start gesture tracking by invoking KinectManager.DetectGesture()-function.
public UserDetected ( long userId, int userIndex ) : void
userId long User ID
userIndex int User index
return void
    public void UserDetected(long userId, int userIndex)
	{
		// the gestures are allowed for the primary user only
		KinectManager manager = KinectManager.Instance;
		if(!manager || (userIndex != playerIndex))
			return;
		
		// detect these user specific gestures
		manager.DetectGesture(userId, KinectGestures.Gestures.SwipeLeft);
		manager.DetectGesture(userId, KinectGestures.Gestures.SwipeRight);
		manager.DetectGesture(userId, KinectGestures.Gestures.SwipeUp);
        manager.DetectGesture(userId, KinectGestures.Gestures.Tpose);
        manager.DetectGesture(userId, KinectGestures.Gestures.LeanLeft);
        manager.DetectGesture(userId, KinectGestures.Gestures.LeanRight);
        manager.DetectGesture(userId, KinectGestures.Gestures.Stop);
        manager.DetectGesture(userId, KinectGestures.Gestures.LeanForward);
        manager.DetectGesture(userId, KinectGestures.Gestures.LeanBack);



	    sGestureText = "change the slides.";
		
	}