41 lines
No EOL
914 B
C#
41 lines
No EOL
914 B
C#
using Domain;
|
|
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;
|
|
}
|
|
|
|
private void Update() {
|
|
CheckInput();
|
|
}
|
|
|
|
public void UpdateView(int score) {
|
|
animator.PlayUntil(_model.GrowPercentage);
|
|
text.text = score.ToString();
|
|
}
|
|
|
|
private void CheckInput() {
|
|
_customInput.UpdateInput();
|
|
|
|
if (_customInput.AnyKeyDown())
|
|
_click.Execute();
|
|
}
|
|
}
|
|
} |