Esempio n. 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();
            }
        }
Esempio n. 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);
        }
Esempio n. 3
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);
            }

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