Exemplo n.º 1
0
        public void Execute(int index, TransformAccess transform)
        {
            var CameraMovementJobStateStruct = this.CameraMovementJobState[0];

            var cameraFollowPosition        = CameraFollowSystem.CameraFollowTargetMovement(ref CameraMovementJobStateStruct);
            var cameraDeltaRotation         = CameraOrientationSystem.CameraRotation(in CameraMovementJobStateStruct);
            var cameraPanningDeltaPosition  = CameraPanningSystem.CameraPanningMovement(ref CameraMovementJobStateStruct);
            var cameraVerticalRotationDelta = CameraVerticalRotationSystem.CameraVerticalRotation(ref CameraMovementJobStateStruct);
            var cameraZoomValue             = CameraZoomSystem.CameraZoom(ref CameraMovementJobStateStruct);

            var CameraObject = CameraMovementJobStateStruct.CameraObject;

            var rotation = math.mul(cameraDeltaRotation, CameraObject.CameraPivotPointTransformWithoutOffset.rot);

            CameraObject.CameraPivotPointTransformWithoutOffset = new RigidTransform(rotation, cameraFollowPosition);
            CameraObject.CameraSize = cameraZoomValue;

            CameraMovementJobStateStruct.CameraObject = CameraObject;

            this.CameraMovementJobState[0] = CameraMovementJobStateStruct;

            transform.position = cameraFollowPosition + cameraPanningDeltaPosition;
            transform.rotation = math.mul(rotation, cameraVerticalRotationDelta);
        }