自動調理破棄時に個数を赤色にする対応
This commit is contained in:
		
							parent
							
								
									530bad4a4f
								
							
						
					
					
						commit
						240c078973
					
				|  | @ -8,12 +8,21 @@ namespace MyGame.Scenes.Main.Scripts | ||||||
|     { |     { | ||||||
|         [SerializeField] private Transform target; |         [SerializeField] private Transform target; | ||||||
|         [SerializeField] private Text amountText; |         [SerializeField] private Text amountText; | ||||||
|  |         private Color redColor; | ||||||
|  |         private void Awake() | ||||||
|  |         { | ||||||
|  |             ColorUtility.TryParseHtmlString(Const.RedColorString, out redColor); | ||||||
|  |         } | ||||||
| 
 | 
 | ||||||
|         public void SetView(ProductData data) |         public void SetView(ProductData data, bool red = false) | ||||||
|         { |         { | ||||||
|             target.DestroyAllChildrens(); |             target.DestroyAllChildrens(); | ||||||
|             Instantiate(data.GetIconPrefab(), target); |             Instantiate(data.GetIconPrefab(), target); | ||||||
|             amountText.text = $"×{data.volume}"; |             amountText.text = $"×{data.volume}"; | ||||||
|  |             if (red) | ||||||
|  |             { | ||||||
|  |                 amountText.color = redColor; | ||||||
|  |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         public void SetActive(bool active) |         public void SetActive(bool active) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue