private void Awake() { if (instance == null) { instance = this; } }
public void SetGameItem(ShopItem item, UIShopManager manager) { uiShopManager = manager; shopItem = item; goldPrice = shopItem.PriceGold; silverPrice = shopItem.PriceSilver; lblName.text = GameManager.localization.getItem(item.ItemId).Name; _playTween = btnInformation.GetComponent <UIPlayTween>(); _playTween.tweenTarget = uiShopManager.uiItemReview.gameObject; btnInformation.gameObject.SetActive(true); IconOfItem.mainTexture = Helper.LoadTextureForSupportItem(item.ItemId); IconOfItem.SetDimensions(120, 120); if (item.UserLevel > 0) { lblLevel.text = string.Format(GameManager.localization.GetText("Shop_MinLevel"), item.UserLevel, item.UserLevel + 4); } _disable = false; if (manager.activeTab == UIShopManager.ActiveTab.IOSReCharge) { itemPriceRoot.SetActive(false); vaultRoot.SetActive(true); float VNDPrice = 0; if (Global.language == Global.Language.VIETNAM) { VNDPrice = item.PriceVND; } else { VNDPrice = item.PriceUSD; } if (item.PriceGoldSale > 0) { lblVaultGold.text = string.Format(GameManager.localization.GetText("Shop_GoldFormat"), item.PriceGoldSale); } else if (item.PriceSilverSale > 0) { lblVaultGold.text = string.Format(GameManager.localization.GetText("Shop_SilverFormat"), item.PriceSilverSale); } lblVaultVND.text = string.Format(GameManager.localization.GetText("Shop_VNDFormat"), VNDPrice); if (item.Promotion > 0) { bonusRoot.SetActive(true); lblBonus.text = string.Format(GameManager.localization.GetText("Shop_GoldFormat"), item.Promotion); } } else { itemPriceRoot.SetActive(true); vaultRoot.SetActive(false); } }
public ShopController(UIShopManager uiShopManager) : base() { _uiShopManager = uiShopManager; }
void Start() { playerState = PlayerState._instance; playerBag = playerState.GetPlayerBag(); isShowPanel = false; //equepInfo = plyerState.getPlayerEquep(); dictionaryUIBagItem = new Dictionary<int, GameObject>(); dictionaryEquep = new Dictionary<ItemType, ItemInfo>(); mainControllerUI = GameObject.FindGameObjectWithTag(Tags.UIRoot).GetComponent<UIController>(); containBagGrid = transform.Find("BagBG").Find("Scroll View").Find("Items").gameObject; containEqueps = transform.Find("EquepBG").gameObject; containEquepInfo = transform.Find("ItemInfoPanel").Find("ItemInfoBG").gameObject; containShop = transform.Find("ShopBG").gameObject; containState = containEqueps.transform.Find("StateBG"); HPstate = containState.Find("LabelHPstate").GetComponent<UILabel>(); STRstate = containState.Find("LabelSTRstate").GetComponent<UILabel>(); DEXstate = containState.Find("LabelDEXstate").GetComponent<UILabel>(); INTstate = containState.Find("LabelINTstate").GetComponent<UILabel>(); Energystate = containState.Find("LabelEnergystate").GetComponent<UILabel>(); EXPstate = containState.Find("LabelEXPstate").GetComponent<UILabel>(); ATKstate = containState.Find("LabelATKstate").GetComponent<UILabel>(); DEFstate = containState.Find("LabelDEFstate").GetComponent<UILabel>(); CONstate = containState.Find("LabelCONstate").GetComponent<UILabel>(); Moneystate = transform.Find("BagBG").Find("LabelMoney").GetComponent<UILabel>(); shopManagerUI = containShop.GetComponent<UIShopManager>(); playerState.OnPlayerStateChanged += OnStatesChanged; gameObject.SetActive(false); containEquepInfo.SetActive(false); }