Esempio n. 1
0
        private void SetSkinStore(SetSkinStoreMsg msg)
        {
            string path;

            if (msg.character == Character.Boy)
            {
                path = "UIImage/Character/BoyRtt";
            }
            else
            {
                path = "UIImage/Character/GirlRtt";
            }
            imgNowCharacter.texture = Resources.Load <Texture>(path);

            txtCoin.text = string.Format("코인 : {0}", msg.coin);
            btnBuy.gameObject.SetActive(false);

            int childCount = parent.transform.childCount;

            for (int i = 0; i < childCount; i++)
            {
                Destroy(parent.transform.GetChild(i).gameObject);
            }

            int   skinCount = msg.ListIsHave.Count;
            float itemY     = itemButton.GetComponent <RectTransform>().sizeDelta.y;

            parent.GetComponent <RectTransform>().sizeDelta        = new Vector2(parent.GetComponent <RectTransform>().sizeDelta.x, itemY * skinCount);
            parent.GetComponent <RectTransform>().anchoredPosition = new Vector3(420, 0, 0);

            for (int i = 0; i < skinCount; i++)
            {
                GameObject temp = GameObject.Instantiate(itemButton) as GameObject;
                temp.transform.parent        = parent.transform;
                temp.transform.localScale    = Vector3.one;
                temp.transform.localPosition = new Vector3(0, -itemY * i, 0);
                temp.GetComponent <Skin_Item_Controller>().InitButton(msg.ListSkin[i].index, msg.ListSkin[i].path, msg.ListSkin[i].cost, msg.ListIsHave[i]);
            }
        }
Esempio n. 2
0
 private void SetSkinStore(SetSkinStoreMsg msg)
 {
 }