Implement Bombs
This commit is contained in:
@@ -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.01f);
|
||||
this.transform.position = Vector2.Lerp(this.transform.position, positionBasedOnIndex.ToVector2(), 0.05f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
24
Assets/Scripts/Views/ScoreView.cs
Normal file
24
Assets/Scripts/Views/ScoreView.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Views {
|
||||
public class ScoreView : MonoBehaviour {
|
||||
private TextMeshProUGUI scoreText;
|
||||
private float displayScore = 0;
|
||||
private int actualScore = 0;
|
||||
|
||||
private void Awake() {
|
||||
this.scoreText = GetComponentInChildren<TextMeshProUGUI>();
|
||||
}
|
||||
|
||||
public void UpdateScore() {
|
||||
this.displayScore = Mathf.Lerp(this.displayScore, this.actualScore, 5 * Time.deltaTime);
|
||||
this.scoreText.text = this.displayScore.ToString("0");
|
||||
}
|
||||
|
||||
public void SetScore(int score) {
|
||||
this.actualScore = score;
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Scripts/Views/ScoreView.cs.meta
Normal file
3
Assets/Scripts/Views/ScoreView.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 86d965b2c3d5474082911bdd360847ce
|
||||
timeCreated: 1765733889
|
||||
Reference in New Issue
Block a user