public static CharKeyItemObject Create(object target) { CharKeyItemObject displayItemObject = ReferencePool.Acquire <CharKeyItemObject>(); displayItemObject.Initialize(target); return(displayItemObject); }
private CharKeyItem CreateCharKeyItem(int entity) { CharKeyItem displayItem = null; CharKeyItemObject displayItemObject = m_CharKeyItemObjectPool.Spawn(); if (displayItemObject != null) { displayItem = (CharKeyItem)displayItemObject.Target; } else { displayItem = Instantiate(m_CharKeyItemTemplate); Transform transform = displayItem.GetComponent <Transform>(); transform.SetParent(m_CharKeyInstanceRoot); transform.localScale = Vector3.one; m_CharKeyItemObjectPool.Register(CharKeyItemObject.Create(displayItem), true); } return(displayItem); }