49 lines
No EOL
1.2 KiB
C#
49 lines
No EOL
1.2 KiB
C#
using Domain;
|
|
using Domain.Input;
|
|
using Presenter;
|
|
using TMPro;
|
|
using UnityEngine;
|
|
|
|
namespace View.UI {
|
|
public class ExpressionInput : MonoBehaviour, IExpressionInput {
|
|
[SerializeField] private TMP_Text text;
|
|
private ExpressionClick _click;
|
|
private CustomInput _customInput;
|
|
|
|
private void Start() {
|
|
_click = FindObjectOfType<Dependencies>().ExpressionClick;
|
|
_customInput = FindObjectOfType<Dependencies>().CustomInput;
|
|
}
|
|
|
|
private void Update() {
|
|
CheckInput();
|
|
}
|
|
|
|
private void CheckInput() {
|
|
_customInput.UpdateInput();
|
|
|
|
if (_customInput.KeyDown(typeof(GeminadaReader)))
|
|
_click.Execute();
|
|
if (_customInput.KeyDown(typeof(CedillaReader)))
|
|
_click.Execute();
|
|
if (_customInput.KeyDown(typeof(IxReader)))
|
|
_click.Execute();
|
|
if (_customInput.KeyDown(typeof(LlReader)))
|
|
_click.Execute();
|
|
if (_customInput.KeyDown(typeof(NyReader)))
|
|
_click.Execute();
|
|
if (_customInput.KeyDown(typeof(SsReader)))
|
|
_click.Execute();
|
|
if (_customInput.KeyDown(typeof(TgReader)))
|
|
_click.Execute();
|
|
if (_customInput.KeyDown(typeof(TjReader)))
|
|
_click.Execute();
|
|
if (_customInput.KeyDown(typeof(TxReader)))
|
|
_click.Execute();
|
|
}
|
|
|
|
public void UpdateView(int score) {
|
|
text.text = score.ToString();
|
|
}
|
|
}
|
|
} |