private void UpdateCameraLocation()
        {
            CameraOffSets offsets = new CameraOffSets();

            if (tpc.isCrouched && tpc.isADS)
            {
                offsets = tpCamera.ADSCrouchingOffset;
            }
            else if (tpc.isSprinting)
            {
                offsets = tpCamera.SprintingOffset;
            }
            else if (tpc.isCrouched)
            {
                offsets = tpCamera.crouchOffset;
            }
            else if (tpc.isADS)
            {
                offsets = tpCamera.ADSStandingOffSet;
            }
            else
            {
                offsets = tpCamera.DefaultOffset;
            }

            //  If we changed our cameras - update
            if (offsets != tpCamera.currentCamera)
            {
                tpCamera.SetCurrentCamera(current: offsets);
            }
        }
Пример #2
0
 /// <summary>
 ///     Set where the camera should currently be
 /// </summary>
 /// <param name="current"></param>
 public void SetCurrentCamera(CameraOffSets current)
 {
     currentCamera = current;
 }