Ejemplo n.º 1
0
        public static ExpBarItemObject Create(object target)
        {
            ExpBarItemObject expBarItemObject = ReferencePool.Acquire <ExpBarItemObject>();

            expBarItemObject.Initialize(target);
            return(expBarItemObject);
        }
Ejemplo n.º 2
0
        private ExpBarItem CreateExpBarItem(Entity entity)
        {
            ExpBarItem       expBarItem       = null;
            ExpBarItemObject expBarItemObject = m_ExpBarItemObjectPool.Spawn();

            if (expBarItemObject != null)
            {
                expBarItem = (ExpBarItem)expBarItemObject.Target;
            }
            else
            {
                expBarItem = Instantiate(m_ExpBarItemTemplate);
                Transform transform = expBarItem.GetComponent <Transform>();
                transform.SetParent(m_ExpBarInstanceRoot);
                transform.localScale = Vector3.one;
                m_ExpBarItemObjectPool.Register(ExpBarItemObject.Create(expBarItem), true);
            }

            return(expBarItem);
        }