feat: Setup MVP
This commit is contained in:
		
							parent
							
								
									14fdd4558e
								
							
						
					
					
						commit
						1dd490b7ed
					
				
					 27 changed files with 555 additions and 52 deletions
				
			
		
							
								
								
									
										32
									
								
								Assets/Scripts/View/CTrencadaInput.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								Assets/Scripts/View/CTrencadaInput.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,32 @@
 | 
			
		|||
using Domain;
 | 
			
		||||
using Presenter;
 | 
			
		||||
using SatorImaging.AppWindowUtility;
 | 
			
		||||
using TMPro;
 | 
			
		||||
using UnityEngine;
 | 
			
		||||
 | 
			
		||||
namespace View {
 | 
			
		||||
	public class CTrencadaInput : MonoBehaviour, ICTrencadaInput {
 | 
			
		||||
		[SerializeField] private TMP_Text text;
 | 
			
		||||
		private CTrencadaClick _click;
 | 
			
		||||
 | 
			
		||||
		private void Start() {
 | 
			
		||||
			AppWindowUtility.AlwaysOnTop = true;
 | 
			
		||||
 | 
			
		||||
			_click = FindObjectOfType<Dependencies>().CTrencadaClick;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		private void Update() {
 | 
			
		||||
			CheckInput();
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		private void CheckInput() {
 | 
			
		||||
			Win32API.UpdateInput();
 | 
			
		||||
			if (Win32API.CTrencadaDown())
 | 
			
		||||
				_click.Execute();
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		public void UpdateView(int score) {
 | 
			
		||||
			text.text = score.ToString();
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue