| 
									
										
										
										
											2022-05-23 13:39:59 +00:00
										 |  |  |  | using System.Collections; | 
					
						
							|  |  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  |  | using UnityEngine; | 
					
						
							|  |  |  |  | using UnityEngine.UI; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | public class CardCell : MonoBehaviour | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     [SerializeField] Image mImgIcon; | 
					
						
							|  |  |  |  |     [SerializeField] Text mTxtName; | 
					
						
							|  |  |  |  |     [SerializeField] Text mTxtDamage; | 
					
						
							|  |  |  |  |     [SerializeField] Text mTxtHp; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |     [SerializeField] GameObject mGobNormal; | 
					
						
							|  |  |  |  |     [SerializeField] GameObject mGobLock; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |     public void InitCell(string pCardID, bool pLocked = false) | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         CardData tCard = GameConfig.Instance.GetCardData(pCardID); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-07-04 11:17:39 +00:00
										 |  |  |  |         mImgIcon.sprite = ResourceManager.Instance.LoadRes<Sprite>(Const.Path.GetSoldierIcon(tCard.CardID)); | 
					
						
							| 
									
										
										
										
											2022-05-23 13:39:59 +00:00
										 |  |  |  |         mTxtName.text = LanguageConfig.Instance.GetText(tCard.CardID); | 
					
						
							|  |  |  |  |         mTxtDamage.text = UIUtils.NumForShort(tCard.Damage); | 
					
						
							|  |  |  |  |         mTxtHp.text = UIUtils.NumForShort(tCard.MaxHp); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         mGobNormal.SetActive(!pLocked); | 
					
						
							|  |  |  |  |         mGobLock.SetActive(pLocked); | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } |