void UpdateJointObjTransform() { float[] gama = new float[3] { gamma1, gamma2, gamma3 }; for (int index = 0; index < 3; index++) { indexFingerJoints[index].localEulerAngles = defaultAngles[indexFingerJoints[index]] + new Vector3(0, gama[index], 0); } thumbJoints[0].localEulerAngles = defaultAngles[thumbJoints[0]] + new Vector3(0, alpha1, beta); thumbJoints[1].localEulerAngles = defaultAngles[thumbJoints[1]] + new Vector3(0, alpha2, 0); OnJointUpdate?.Invoke(this, null); }
IEnumerator UpdateJointObjTransformAsync() { float[] gama = new float[3] { gamma1, gamma2, gamma3 }; for (int index = 0; index < 3; index++) { indexFingerJoints[index].localEulerAngles = defaultAngles[indexFingerJoints[index]] + new Vector3(0, gama[index], 0); } thumbJoints[0].localEulerAngles = defaultAngles[thumbJoints[0]] + new Vector3(0, alpha1, beta); thumbJoints[1].localEulerAngles = defaultAngles[thumbJoints[1]] + new Vector3(0, alpha2, 0); // need some time here for joints object to update in Unity yield return(new WaitForFixedUpdate()); OnJointUpdate?.Invoke(this, null); }