private void Initialize() { this.bottlesystemitem = Resources.Load <BottleSystemItem>("Prefab/UI/Bottle/BottleSystemItem"); this.itemsGrid = base.transform.Find("ItemsGrid").GetComponent <UIGrid>(); this.details = base.transform.Find("Detail"); this.itemBG = this.details.Find("GoldenFrame/ItemBG"); }
private void ParseType(BottleSystemItem item) { string text = string.Empty; string text2 = string.Empty; text = item.Type; text2 = item.Name; this.details.GetChild(1).GetChild(0).GetComponent <UILabel>().text = text; this.details.GetChild(1).GetChild(1).GetComponent <UILabel>().text = text2; switch (item.ItemType) { case 1: this.itemBG.GetChild(1).GetComponent <UITexture>().mainTexture = ResourceManager.Load <Texture>(item.Icon_detail, true, true, null, 0, false); this.details.GetChild(1).GetChild(1).GetComponent <UILabel>().text = item.ItemCount.ToString(); break; case 2: this.itemBG.GetChild(0).GetChild(0).GetComponent <UISprite>().spriteName = item.Icon; this.itemBG.GetChild(1).GetComponent <UITexture>().mainTexture = ResourceManager.Load <Texture>(item.Icon_detail, true, true, null, 0, false); break; case 3: this.itemBG.GetChild(1).GetComponent <UITexture>().mainTexture = ResourceManager.Load <Texture>(item.Icon_detail, true, true, null, 0, false); break; } this.details.localPosition = new Vector3(-1090f, 25f, 0f) + new Vector3((float)(102 * item.Position), 0f, 0f); this.itemBG.GetChild(0).gameObject.SetActive(item.ItemType == 2 && "符文" == item.Type); this.itemBG.GetChild(1).gameObject.SetActive("符文" != item.Type); }
private void ShowDetails(GameObject obj, bool isIn) { if (null != obj) { this.ParseType(obj.GetComponent <BottleSystemItem>()); this.details.gameObject.SetActive(isIn); this.temp = obj.GetComponent <BottleSystemItem>(); } else if (this.temp.Position == obj.GetComponent <BottleSystemItem>().Position) { this.details.gameObject.SetActive(false); } else { this.ParseType(obj.GetComponent <BottleSystemItem>()); this.temp = obj.GetComponent <BottleSystemItem>(); } }