public void Disable(CameraParams cameraParams)
 {
     if (IsEnabled)
     {
         cameraParams.SetParams (savedParams);
         IsEnabled = false;
     }
 }
 public void Enable(CameraParams cameraParams)
 {
     if (!IsEnabled)
     {
         SetInitialPosition(cameraParams.position);
         IsEnabled = true;
     }
 }
 public void Disable(CameraParams cameraParams)
 {
     if (IsEnabled)
     {
         cameraParams.position = initialPosition;
         IsEnabled = false;
     }
 }
 public void Enable(CameraParams cameraParams)
 {
     if (!IsEnabled)
     {
         savedParams = new CameraParams(cameraParams);
         cameraParams.SetParams (param);
         IsEnabled = true;
     }
 }
 public void UpdateParams(CameraParams cameraParams)
 {
     if (IsInterpolating)
     {
         interpolator.Update (Time.deltaTime);
         cameraParams.SetParams (interpolator.CurrentParams);
         sourceParams.SetParams (cameraParams);
     }
 }
        public void UpdateParams(CameraParams cameraParams)
        {
            Vector3 panDelta;

            if (IsDragging(out panDelta))
                UpdatePanningWhileDragging(panDelta, ref cameraParams.position);
            else
                UpdatePanningWhileNotDragging(ref cameraParams.position);
        }
Esempio n. 7
0
        public static CameraParams Slerp(CameraParams a, CameraParams b, float interpPct)
        {
            CameraParams result = new CameraParams();

            result.position = Vector3.Slerp(a.position, b.position, interpPct);
            result.rotation = Quaternion.Lerp(Quaternion.Euler (a.rotation),  Quaternion.Euler (b.rotation), interpPct).eulerAngles;
            result.fov = Mathf.Lerp (a.fov, b.fov, interpPct);

            return result;
        }
        public void UpdateParams(CameraParams cameraParams)
        {
            float delta = CalculateDelta();

            if (delta > 0.0001f || delta < -0.0001f)
            {
                currentZoomValue = Mathf.Clamp01 (currentZoomValue + delta);
                ApplyCurrentZoom(cameraParams);
            }
        }
        public void UpdateParams(CameraParams cameraParams)
        {
            float delta = CalculateDelta();

            if (delta > 0.0001f || delta < -0.0001f)
            {
                Vector3 lookAtFloorPoint = cameraParams.LookAtFloorPoint;
                float distToLookAtPoint = Vector3.Distance(cameraParams.position, lookAtFloorPoint);

                cameraParams.rotation.y += delta;
                cameraParams.position = lookAtFloorPoint + (-cameraParams.Forward * distToLookAtPoint);
            }
        }
 public void Disable(CameraParams cameraParams)
 {
     IsEnabled = false;
     proxyAnimator.Play (idleStateName);
 }
 public void UpdateParamsWhenAdded(CameraParams cameraParams)
 {
     Vector3 deltaMove = GetCurrentOffsetFromTarget(cameraParams);
     Move(deltaMove, ref cameraParams.position);
 }
 public void Initialize(CameraParams cameraParams)
 {
     sourceParams = new CameraParams(cameraParams);
     interpolator = new CameraParamsInterp(sourceParams, new CameraParams(cameraParams), interpDuration);
 }
 public void SetTarget(CameraParams targetParams)
 {
     interpolator.SetParams(sourceParams, targetParams, interpDuration);
 }
 public void UpdateParams(CameraParams cameraParams)
 {
     Vector3 shakeDisplacement = CalculateDisplacementForThisFrame();
     cameraParams.position += shakeDisplacement;
 }
 public void Enable(CameraParams cameraParams)
 {
     sourceParams.SetParams(cameraParams);
     IsEnabled = true;
 }
 public void Enable(CameraParams cameraParams)
 {
     IsEnabled = true;
     proxyAnimatorTransform = proxyAnimator.transform;
 }
Esempio n. 17
0
 public void SetParams(CameraParams param)
 {
     SetParams (param.position, param.rotation, param.fov);
 }
 private Vector3 GetCurrentOffsetFromTarget(CameraParams cameraParams)
 {
     Vector3 lookAt = transformToFollow.position + offsetFromTarget;
     return lookAt - cameraParams.GetLookAtPointInYPlane(lookAt.y);
 }
 public void Disable(CameraParams cameraParams)
 {
     IsEnabled = false;
 }
 public void UpdateParamsWhenAdded(CameraParams cameraParams)
 {
     ApplyCurrentZoom(cameraParams);
 }
 public void UpdateParams(CameraParams cameraParams)
 {
     float movePct = Mathf.Min (interpSpeed * Time.deltaTime, 1.0f);
     Vector3 deltaMove = GetCurrentOffsetFromTarget(cameraParams) * movePct;
     Move(deltaMove, ref cameraParams.position);
 }
 public void UpdateParams(CameraParams cameraParams)
 {
     cameraParams.fov = fov;
     cameraParams.position = proxyAnimatorTransform.position;
     cameraParams.rotation = proxyAnimatorTransform.rotation.eulerAngles;
 }
 private void ApplyCurrentZoom(CameraParams cameraParams)
 {
     CurrentZoomParams.ApplyTo(cameraParams);
 }
 public void SetParams(CameraParams param)
 {
     this.param = param;
 }
 public void Enable(CameraParams cameraParams)
 {
     IsEnabled = true;
 }
 public void UpdateParams(CameraParams cameraParams)
 {
 }
 public void UpdateParamsWhenAdded(CameraParams cameraParams)
 {
 }
Esempio n. 28
0
 public CameraParams(CameraParams param)
 {
     SetParams (param);
 }