refactor: Reading all inputs from a single method
This commit is contained in:
		
							parent
							
								
									3e31ecc943
								
							
						
					
					
						commit
						c1a8b06f43
					
				
					 2 changed files with 22 additions and 40 deletions
				
			
		|  | @ -26,34 +26,16 @@ namespace View.UI { | |||
| 			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(); | ||||
| 			if(_customInput.KeyDown(typeof(AObertaReader))) | ||||
| 				_click.Execute(); | ||||
| 		} | ||||
| 
 | ||||
| 		public void UpdateView(int score) { | ||||
| 			animator.PlayUntil(_model.GrowPercentage); | ||||
| 			text.text = score.ToString(); | ||||
| 		} | ||||
| 
 | ||||
| 		private void CheckInput() { | ||||
| 			_customInput.UpdateInput(); | ||||
| 
 | ||||
| 			if (_customInput.AnyKeyDown()) | ||||
| 				_click.Execute(); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Gerard Gascón
						Gerard Gascón