private void UpdateRotation() { if (TargetRotation == null) { return; } Quaternion targetRotation = Quaternion.Euler(0, 0, TargetRotation.Value); if (RotationSpeed == InstantSpeedValue) { transform.rotation = targetRotation; } else { var deltaTimedRotationSpeed = UiViewHelper.GetDeltaTimedSpeed(RotationSpeed); transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, deltaTimedRotationSpeed); } }
private void UpdateScale() { if (TargetScaling == null) { return; } var targetTransformScale = OriginalTransformScale * TargetScaling.Value; if (ScalingSpeed == InstantSpeedValue) { transform.localScale = targetTransformScale; } else { var animationSpeed = UiViewHelper.GetDeltaTimedSpeed(ScalingSpeed); transform.localScale = Vector3.Lerp(transform.localScale, targetTransformScale, ScalingSpeed); } }
private void UpdatePosition() { if (TargetPosition == null) { return; } float zLock = this.UiViewLayer.GetUiViewLayerZPosition(); var zLockedTargetPosition = new Vector3(TargetPosition.x, TargetPosition.y, zLock); if (MovementSpeed == InstantSpeedValue) { transform.position = zLockedTargetPosition; } else { var deltaTimedMoveSpeed = UiViewHelper.GetDeltaTimedSpeed(MovementSpeed); transform.position = Vector3.MoveTowards(transform.position, zLockedTargetPosition, deltaTimedMoveSpeed); } }