Example #1
0
        protected override void PostPipelineStageCallback(
            CinemachineVirtualCameraBase vcam,
            CinemachineCore.Stage stage, ref CameraState state, float deltaTime)
        {
            if (stage == CinemachineCore.Stage.Body)
            {
                _framingTransposer = ((CinemachineVirtualCamera)vcam).GetCinemachineComponent <CinemachineFramingTransposer>();

                if (_framingTransposer == null)
                {
                    return;
                }

                float d = Vector3.Distance(state.CorrectedPosition, state.ReferenceLookAt);

                float _distance = m_CameraDistance;

                // Apply damping
                if (deltaTime >= 0 && m_Damping > 0)
                {
                    float delta = m_CameraDistance - d;
                    delta     = Damper.Damp(delta, m_Damping, deltaTime);
                    _distance = d + delta;
                }


                _framingTransposer.m_CameraDistance = _distance;
            }
        }
Example #2
0
    protected override void Awake()
    {
        base.Awake();

        this._framingTransposer = this._virtualCamera.GetCinemachineComponent <Cinemachine.CinemachineFramingTransposer>();

        this._scrollDistanceIndex = this._scrollDistances.Length - 1;
    }
Example #3
0
    private void DoLaunch()
    {
        if (orbiter.objectToOrbit != null)
        {
            orbiter.objectToOrbit.rr.gameObject.SetActive(true);

            Cinemachine.CinemachineFramingTransposer t = cometCam.GetCinemachineComponent <Cinemachine.CinemachineFramingTransposer>();
        }

        currentState          = State.Launched;
        orbiter.objectToOrbit = null;
        rb.isKinematic        = false;
        rb.velocity           = lastVelocity;
        OnLaunch.Invoke();
    }