Exemple #1
0
        /// Evaluate the animation and update the simulation service to apply input.
        private void Evaluate()
        {
            if (animation == null)
            {
                localTime = 0.0f;
                isPlaying = false;

                return;
            }

            if (animation.HasCameraPose && CameraCache.Main)
            {
                var cameraPose = animation.EvaluateCameraPose(localTime);
                CameraCache.Main.transform.SetPositionAndRotation(cameraPose.Position, cameraPose.Rotation);
            }

            if (animation.HasHandData)
            {
                EvaluateHandData(HandDataLeft, Handedness.Left);
                EvaluateHandData(HandDataRight, Handedness.Right);
            }

            if (animation.HasEyeGaze)
            {
                EvaluateEyeGaze();
            }
        }
Exemple #2
0
        /// Evaluate the animation and update the simulation service to apply input.
        private void Evaluate()
        {
            if (animation == null)
            {
                SetPlaying(false);
                localTime = 0.0f;
                return;
            }

            if (CameraCache.Main)
            {
                var cameraPose = animation.EvaluateCameraPose(localTime);
                CameraCache.Main.transform.SetPositionAndRotation(cameraPose.Position, cameraPose.Rotation);
            }

            EvaluateHandData(HandDataLeft, Handedness.Left);
            EvaluateHandData(HandDataRight, Handedness.Right);
        }
        /// Evaluate the animation and update the simulation service to apply input.
        private void Evaluate()
        {
            if (animation == null)
            {
                SetPlaying(false);
                localTime = 0.0f;
                return;
            }

            if (CameraCache.Main)
            {
                var cameraPose = animation.EvaluateCameraPose(localTime);
                CameraCache.Main.transform.SetPositionAndRotation(cameraPose.Position, cameraPose.Rotation);
            }

#if UNITY_EDITOR
            if (InputSimService != null)
            {
                EvaluateHandData(InputSimService.HandDataLeft, Handedness.Left);
                EvaluateHandData(InputSimService.HandDataRight, Handedness.Right);
            }
#endif
        }