void Update() { #region Check for Lerp bool once = false; if (mPositionLerp.LerpIsActive()) { Vector2 p = mPositionLerp.UpdateLerp(); transform.position = new Vector3(p.x, p.y, transform.position.z); once = true; } if (mSizeLerp.LerpIsActive()) { Vector2 p = mSizeLerp.UpdateLerp(); mTheCamera.orthographicSize = p.x; once = true; } if (once) { UpdateWorldWindowBound(); } #endregion #region Check for Shake if (!mShake.ShakeDone()) { transform.position = mShake.UpdateShake(); } #endregion }
// Update is called once per frame void Update() { Vector3 pos = hero.transform.position; pos.z = transform.position.z; float fade = Mathf.Min(8 * Time.smoothDeltaTime); origin = Vector3.Lerp(transform.position, pos, fade); transform.position = origin + shakePosition.UpdateShake(); }
private void Update() { if (!shakePosition.ShakeDone()) { transform.position = shakePosition.UpdateShake(); } else { if (shaking) { //Clears the waypoint variables.waypointCam.SetWaypoint(this, true); shaking = false; } } }