private void Spin()
{
if (keepSpinning) {
if (unfocusProgress < unfocusDuration) {
unfocusProgress += Time.deltaTime;
unfocusProgressPercentage = unfocusProgress / unfocusDuration;
}
var spinRotation = Quaternion.Euler(baseRotation.x, baseRotation.y + spinDirection * spinAngle * Mathf.Sin(spinSpeed * Time.time + randomOffset), baseRotation.z);
transform.rotation = Quaternion.Lerp(transform.rotation, spinRotation, unfocusProgressPercentage);
} else {
keepSpinning = spinEnabled;
}
}