示例#1
0
    private void InternalUpdate(float deltaTime)
    {
        UpdateGameCamera(deltaTime);

        if (_isCinematicActive)
        {
            Vector3    tempPosition = Vector3.zero;
            Quaternion tempQuat     = Quaternion.identity;
            Cinematic.GetCurrentCinematicTransform(ref tempPosition, ref tempQuat);

            transform.position = tempPosition;
            transform.rotation = tempQuat;
        }

        if (_isStillCamActive)
        {
            transform.position = _stillCameraPosition;
            transform.rotation = _stillCameraRotation;
        }

#if DEBUG
        // if we are turning the debug camera on
        if (_previousFrameDebugCamera != debugCamera && eDebugCameraType.None == _previousFrameDebugCamera)
        {
            _debugCameraPosition = transform.position;
            _debugCameraRotation = transform.rotation;
        }

        switch (debugCamera)
        {
        case eDebugCameraType.SceneCamera:
            if (null != Camera.current && null != Camera.current.transform)
            {
                _debugCameraPosition = Camera.current.transform.position;
                _debugCameraRotation = Camera.current.transform.rotation;
            }
            break;

        case eDebugCameraType.FlyCamera:
            UpdateDebugFlyCamera();
            break;

        default: break;
        }

        if (eDebugCameraType.None != debugCamera)
        {
            transform.position = _debugCameraPosition;
            transform.rotation = _debugCameraRotation;
        }

        _previousFrameDebugCamera = debugCamera;
#endif
    }
示例#2
0
 // after the dialogue starts cameras, get the transform
 private void GetLatestCameraTransform(Dialogue.DialogueData.DialoguePoint conversation, ref Vector3 outPosition, ref Quaternion outRotation)
 {
     if (Cinematic.IsCinematicActive())
     {
         Cinematic.GetCurrentCinematicTransform(ref outPosition, ref outRotation);
     }
     else
     {
         _cameraComponent.GetNewestGameCameraBehaviorTransform(ref outPosition, ref outRotation);
     }
 }