This commit is contained in:
2025-12-15 03:44:53 +08:00
parent 25a5950e8d
commit 2a3bcf7423
12 changed files with 326 additions and 107 deletions

View File

@@ -28,7 +28,7 @@ namespace Views {
this.isFalling = true;
}
public async UniTaskVoid UpdatePosition(Vector2Int positionBasedOnIndex) {
public async UniTaskVoid UpdatePosition(Vector2Int positionBasedOnIndex, float gemSpeed) {
if (!this.isFalling) {
await FallDelay();
}
@@ -37,7 +37,7 @@ namespace Views {
return;
if (Vector2.Distance(this.transform.position, positionBasedOnIndex.ToVector2()) > 0.01f) {
this.transform.position = Vector2.Lerp(this.transform.position, positionBasedOnIndex.ToVector2(), 0.05f);
this.transform.position = Vector2.Lerp(this.transform.position, positionBasedOnIndex.ToVector2(), gemSpeed);
}
}
}

View File

@@ -12,8 +12,8 @@ namespace Views {
this.scoreText = GetComponentInChildren<TextMeshProUGUI>();
}
public void UpdateScore() {
this.displayScore = Mathf.Lerp(this.displayScore, this.actualScore, 5 * Time.deltaTime);
public void UpdateScore(float scoreSpeed) {
this.displayScore = Mathf.Lerp(this.displayScore, this.actualScore, scoreSpeed * Time.deltaTime);
this.scoreText.text = this.displayScore.ToString("0");
}