// Update is called once per frame void Update() { ulong userId = kinectManager.GetUserIdByIndex(playerIndex); int lElbowIndex = (int)LeftElbowJoint; int rElbowIndex = (int)RightElbowJoint; int lShoulderIndex = (int)LeftShoulderJoint; int rShoulderIndex = (int)RightShoulderJoint; //Get angles made by the joint with the next joint if (kinectManager.IsJointTracked(userId, lElbowIndex)) { leAngle = kinectManager.GetAngleAtJoint(userId, lElbowIndex); } if (kinectManager.IsJointTracked(userId, rElbowIndex)) { reAngle = kinectManager.GetAngleAtJoint(userId, rElbowIndex); } if (kinectManager.IsJointTracked(userId, lShoulderIndex)) { lsAngle = kinectManager.GetAngleAtJoint(userId, lShoulderIndex); } if (kinectManager.IsJointTracked(userId, rShoulderIndex)) { rsAngle = kinectManager.GetAngleAtJoint(userId, rShoulderIndex); } //If the exercise is Bicep Curl if (ExerciseNumber == 1) { BicepCurlFeedback(lsAngle, rsAngle); } //If the exercise is Arnold Press else if (ExerciseNumber == 2) { ArnoldPressFeedback(lsAngle, rsAngle, leAngle, reAngle); } //LeftText.text = "SHOULDER: " + lsAngle.ToString() + "\n" + "ELBOW: " + leAngle.ToString(); //RightText.text = "SHOULDER: " + rsAngle.ToString() + "\n" + "ELBOW: " + reAngle.ToString(); //Debug.Log(new Vector2(lsAngle, rsAngle)); }