void OnHumanBodiesChanged(ARHumanBodiesChangedEventArgs eventArgs) { BoneController boneController; foreach (var humanBody in eventArgs.added) { if (!m_SkeletonTracker.TryGetValue(humanBody.trackableId, out boneController)) { Debug.Log($"Adding a new skeleton [{humanBody.trackableId}]."); var newSkeletonGO = Instantiate(m_SkeletonPrefab, humanBody.transform); boneController = newSkeletonGO.GetComponent <BoneController>(); m_SkeletonTracker.Add(humanBody.trackableId, boneController); } boneController.InitializeSkeletonJoints(); boneController.ApplyBodyPose(humanBody); } if (leftHand == null) { leftHand = GameObject.Find("RightHandRingStart"); } if (rightHand == null) { rightHand = GameObject.Find("LeftHandRingStart"); _boids._Feed = rightHand; } if (leftFoot == null) { leftFoot = GameObject.Find("LeftFoot"); } if (rightFoot == null) { rightFoot = GameObject.Find("RightFoot"); } if (head == null) { head = GameObject.Find("Head"); _brushes.Init(new Transform[] { leftHand.transform, rightHand.transform //leftFoot.transform, //rightFoot.transform, //head.transform }); _bubbleGen.targets = new Transform[] { leftHand.transform, rightHand.transform }; } //UpdateBall( rightHand ); //UpdateBall( leftHand ); //UpdateBall( leftFoot ); //UpdateBall( rightFoot ); //UpdateBall( head ); //syokika //var joints = humanbody //XRHumanBodyJoint joint = joints[i]; foreach (var humanBody in eventArgs.updated) { if (m_SkeletonTracker.TryGetValue(humanBody.trackableId, out boneController)) { boneController.ApplyBodyPose(humanBody); } } foreach (var humanBody in eventArgs.removed) { Debug.Log($"Removing a skeleton [{humanBody.trackableId}]."); if (m_SkeletonTracker.TryGetValue(humanBody.trackableId, out boneController)) { Destroy(boneController.gameObject); m_SkeletonTracker.Remove(humanBody.trackableId); } } }