public void SetMiddleViewOnLeft(CAMERA_VIEW_ROTATION checkCurrentView) { if (checkCurrentView != nextRotation) { nextRotation = CAMERA_VIEW_ROTATION.CVR02_LEFT_ROTATION; currentLerpTime = 0; start = transform.rotation.eulerAngles; end = new Vector3(0, -35, 0); startLerp = true; } }
public void SetLeftViewOnRight(CAMERA_VIEW_ROTATION checkCurrentView) { if (checkCurrentView != nextRotation) { nextRotation = CAMERA_VIEW_ROTATION.CVR01_RIGHT_ROTATION; currentLerpTime = 0; start = transform.rotation.eulerAngles; end = new Vector3(0, 10, 0); startLerp = true; } }
public void SetLeftViewOnDefault(CAMERA_VIEW_ROTATION checkCurrentView) { if (checkCurrentView != nextRotation) { nextRotation = CAMERA_VIEW_ROTATION.CVR00_DEFAULT_ROTATION; currentLerpTime = 0; start = transform.rotation.eulerAngles; end = new Vector3(0, -24, 0); startLerp = true; } }
private void RotationLerp() { float t = currentLerpTime / maxLerpTime; if (t > 1) { t = 1; } transform.eulerAngles = Vector3.Lerp(start, end, t); if (currentLerpTime > maxLerpTime) { currentLerpTime = 0; startLerp = false; currentView = nextRotation; } else { currentLerpTime += Time.deltaTime; } }
private void Start() { currentView = CAMERA_VIEW_ROTATION.CVR00_DEFAULT_ROTATION; nextRotation = CAMERA_VIEW_ROTATION.CVR03_NONE; startLerp = true; }