// Use this for initialization void Start () { playerState = PlayerState._instance; ItemInfoPanel = GameObject.FindGameObjectWithTag(Tags.UIRoot).transform.Find("EquepMenu").Find("ItemInfoPanel").GetComponent<UIItemInfoPanel>(); switch (from) { case ItemFrom.Bag: item = playerState.GetPlayerBag().dictionBag[int.Parse(gameObject.transform.parent.name)]; break; case ItemFrom.Equep: break; case ItemFrom.Shop: item = GameObject.FindGameObjectWithTag(Tags.UIRoot).transform.Find("EquepMenu").Find("ShopBG").GetComponent<UIShopManager>().getShopDictionary()[int.Parse(gameObject.transform.parent.name)]; break; default: break; } }
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); }