コード例 #1
0
 public void Disable(CameraParams cameraParams)
 {
     if (IsEnabled)
     {
         cameraParams.SetParams (savedParams);
         IsEnabled = false;
     }
 }
コード例 #2
0
 public void Enable(CameraParams cameraParams)
 {
     if (!IsEnabled)
     {
         SetInitialPosition(cameraParams.position);
         IsEnabled = true;
     }
 }
コード例 #3
0
 public void Disable(CameraParams cameraParams)
 {
     if (IsEnabled)
     {
         cameraParams.position = initialPosition;
         IsEnabled = false;
     }
 }
コード例 #4
0
 public void Enable(CameraParams cameraParams)
 {
     if (!IsEnabled)
     {
         savedParams = new CameraParams(cameraParams);
         cameraParams.SetParams (param);
         IsEnabled = true;
     }
 }
コード例 #5
0
 public void UpdateParams(CameraParams cameraParams)
 {
     if (IsInterpolating)
     {
         interpolator.Update (Time.deltaTime);
         cameraParams.SetParams (interpolator.CurrentParams);
         sourceParams.SetParams (cameraParams);
     }
 }
コード例 #6
0
        public void UpdateParams(CameraParams cameraParams)
        {
            Vector3 panDelta;

            if (IsDragging(out panDelta))
                UpdatePanningWhileDragging(panDelta, ref cameraParams.position);
            else
                UpdatePanningWhileNotDragging(ref cameraParams.position);
        }
コード例 #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;
        }
コード例 #8
0
        public void UpdateParams(CameraParams cameraParams)
        {
            float delta = CalculateDelta();

            if (delta > 0.0001f || delta < -0.0001f)
            {
                currentZoomValue = Mathf.Clamp01 (currentZoomValue + delta);
                ApplyCurrentZoom(cameraParams);
            }
        }
コード例 #9
0
        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);
            }
        }
コード例 #10
0
 public void Disable(CameraParams cameraParams)
 {
     IsEnabled = false;
     proxyAnimator.Play (idleStateName);
 }
コード例 #11
0
 public void UpdateParamsWhenAdded(CameraParams cameraParams)
 {
     Vector3 deltaMove = GetCurrentOffsetFromTarget(cameraParams);
     Move(deltaMove, ref cameraParams.position);
 }
コード例 #12
0
 public void Initialize(CameraParams cameraParams)
 {
     sourceParams = new CameraParams(cameraParams);
     interpolator = new CameraParamsInterp(sourceParams, new CameraParams(cameraParams), interpDuration);
 }
コード例 #13
0
 public void SetTarget(CameraParams targetParams)
 {
     interpolator.SetParams(sourceParams, targetParams, interpDuration);
 }
コード例 #14
0
 public void UpdateParams(CameraParams cameraParams)
 {
     Vector3 shakeDisplacement = CalculateDisplacementForThisFrame();
     cameraParams.position += shakeDisplacement;
 }
コード例 #15
0
 public void Enable(CameraParams cameraParams)
 {
     sourceParams.SetParams(cameraParams);
     IsEnabled = true;
 }
コード例 #16
0
 public void Enable(CameraParams cameraParams)
 {
     IsEnabled = true;
     proxyAnimatorTransform = proxyAnimator.transform;
 }
コード例 #17
0
 public void SetParams(CameraParams param)
 {
     SetParams (param.position, param.rotation, param.fov);
 }
コード例 #18
0
 private Vector3 GetCurrentOffsetFromTarget(CameraParams cameraParams)
 {
     Vector3 lookAt = transformToFollow.position + offsetFromTarget;
     return lookAt - cameraParams.GetLookAtPointInYPlane(lookAt.y);
 }
コード例 #19
0
 public void Disable(CameraParams cameraParams)
 {
     IsEnabled = false;
 }
コード例 #20
0
 public void UpdateParamsWhenAdded(CameraParams cameraParams)
 {
     ApplyCurrentZoom(cameraParams);
 }
コード例 #21
0
 public void UpdateParams(CameraParams cameraParams)
 {
     float movePct = Mathf.Min (interpSpeed * Time.deltaTime, 1.0f);
     Vector3 deltaMove = GetCurrentOffsetFromTarget(cameraParams) * movePct;
     Move(deltaMove, ref cameraParams.position);
 }
コード例 #22
0
 public void UpdateParams(CameraParams cameraParams)
 {
     cameraParams.fov = fov;
     cameraParams.position = proxyAnimatorTransform.position;
     cameraParams.rotation = proxyAnimatorTransform.rotation.eulerAngles;
 }
コード例 #23
0
 private void ApplyCurrentZoom(CameraParams cameraParams)
 {
     CurrentZoomParams.ApplyTo(cameraParams);
 }
コード例 #24
0
 public void SetParams(CameraParams param)
 {
     this.param = param;
 }
コード例 #25
0
 public void Enable(CameraParams cameraParams)
 {
     IsEnabled = true;
 }
コード例 #26
0
 public void UpdateParams(CameraParams cameraParams)
 {
 }
コード例 #27
0
 public void UpdateParamsWhenAdded(CameraParams cameraParams)
 {
 }
コード例 #28
0
 public CameraParams(CameraParams param)
 {
     SetParams (param);
 }