void FixedUpdate() { if (bgManager == null || !bgManager.GetCanMove()) { return; } sr.material.mainTextureOffset = new Vector2(0, currentOffset); currentOffset += (DifficultyManager.GetMovementSpeed() / 6); }
private void FixedUpdate() { if (!isSetupped) { return; } transform.position = Vector3.MoveTowards(transform.position, transform.position + Vector3.down, DifficultyManager.GetMovementSpeed()); if (transform.position.y < bound.center.y - bound.extents.y - 1f) { DestroyShape(); } }
private IEnumerator BackgroundStartCoroutine() { while (transform.position.y > maxStartPosY) { transform.position = Vector3.MoveTowards(transform.position, transform.position + Vector3.down, DifficultyManager.GetMovementSpeed()); yield return(new WaitForFixedUpdate()); } seamlessBg.Setup(this); canMove = true; }