Separate SetGem and SpawnGemGameObject

This commit is contained in:
2025-12-18 00:21:44 +08:00
parent 9b6d2369c6
commit 2bd94c8df9
3 changed files with 60 additions and 35 deletions

View File

@@ -85,15 +85,13 @@ namespace Views {
this.transform.localScale = Vector3.one;
}
private async UniTask FallDelay() {
float fallDelay = 1 * (this.gem.Position.y / 10f);
await UniTask.WaitForSeconds(fallDelay);
private void FallDelay() {
this.isFalling = true;
}
public async UniTaskVoid UpdatePosition(Vector2Int positionBasedOnIndex, float gemSpeed) {
public void UpdatePosition(Vector2Int positionBasedOnIndex, float gemSpeed) {
if (!this.isFalling) {
await FallDelay();
FallDelay();
}
if (!this.isFalling)