Exemplo n.º 1
0
        private GameObject PopStack(int itemId)
        {
            Transform trans = null;

            if (this.m_itemStack.Count == 0)
            {
                trans = GameObjectUtils.CreateChild(this.m_content, m_itemGameobj.transform);
            }
            else
            {
                lock (m_thisLock)
                {
                    trans = this.m_itemStack.Pop().transform;
                    trans.SetParent(this.m_content);
                }
            }

            trans.localPosition   = this.m_itemPosDic[itemId];
            trans.localScale      = Vector3.one;
            trans.gameObject.name = itemId.ToString();
            trans.gameObject.SetActive(true);
            this.AddItemInfo(trans.gameObject, itemId);

            return(trans.gameObject);
        }