public static CharEntryItemObject Create(object target)
        {
            CharEntryItemObject displayItemObject = ReferencePool.Acquire <CharEntryItemObject>();

            displayItemObject.Initialize(target);
            return(displayItemObject);
        }
Esempio n. 2
0
        private CharEntryItem CreateCharEntryItem(Entity entity)
        {
            CharEntryItem       displayItem       = null;
            CharEntryItemObject displayItemObject = m_CharEntryItemObjectPool.Spawn();

            if (displayItemObject != null)
            {
                displayItem = (CharEntryItem)displayItemObject.Target;
            }
            else
            {
                displayItem = Instantiate(m_CharEntryItemTemplate);
                Transform transform = displayItem.GetComponent <Transform>();
                transform.SetParent(m_CharEntryInstanceRoot);
                transform.localScale = Vector3.one;
                m_CharEntryItemObjectPool.Register(CharEntryItemObject.Create(displayItem), true);
            }

            return(displayItem);
        }