feat: Rose grow animation

This commit is contained in:
Gerard Gascón 2024-04-15 19:13:30 +02:00
parent f8a29f1501
commit 438b16fc6e
9 changed files with 186 additions and 4 deletions

View file

@ -6,7 +6,8 @@
"GUID:d9011953b32919841a6c357880a50fb3",
"GUID:6055be8ebefd69e48b49212b09b47b2f",
"GUID:1220ccfff01d26041a9bb8cd7ae584af",
"GUID:58f2f98b0cec4e74998cb65ad59190b4"
"GUID:58f2f98b0cec4e74998cb65ad59190b4",
"GUID:246088dd927065946b1746223fef2142"
],
"includePlatforms": [],
"excludePlatforms": [],

View file

@ -3,14 +3,21 @@ using Domain.Input;
using Presenter;
using TMPro;
using UnityEngine;
using UnityEngine.Serialization;
namespace View.UI {
public class ExpressionInput : MonoBehaviour, IExpressionInput {
[SerializeField] private TMP_Text text;
private ExpressionClick _click;
private CustomInput _customInput;
private Model _model;
[SerializeField] private FramedAnimator.FramedAnimator animator;
private void Start() {
_model = FindObjectOfType<Dependencies>().Model;
_click = FindObjectOfType<Dependencies>().ExpressionClick;
_customInput = FindObjectOfType<Dependencies>().CustomInput;
}
@ -43,6 +50,9 @@ namespace View.UI {
}
public void UpdateView(int score) {
int frameDifference = score % _model.SpawnRate;
animator.PlayUntil(frameDifference / (float)_model.SpawnRate);
text.text = score.ToString();
}
}