예제 #1
0
        protected override void Release(bool isShutdown)
        {
            IntentItem intentItem = (IntentItem)Target;

            if (intentItem == null)
            {
                return;
            }

            Object.Destroy(intentItem.gameObject);
        }
예제 #2
0
        private IntentItem CreateIntentItem(Entity entity)
        {
            IntentItem       intentItem       = null;
            IntentItemObject intentItemObject = m_IntentObjectPool.Spawn();

            if (intentItemObject != null)
            {
                intentItem = (IntentItem)intentItemObject.Target;
            }
            else
            {
                intentItem = Instantiate(m_IntentItemTemplate, m_WidgetInstanceRoot, false);
                m_IntentObjectPool.Register(IntentItemObject.Create(intentItem), true);
            }
            return(intentItem);
        }
예제 #3
0
        public void ShowIntent(Entity entity, Sprite sp, int value)
        {
            if (entity == null)
            {
                return;
            }

            IntentItem intentItem = GetActiveIntentItem(entity);

            if (intentItem == null)
            {
                intentItem = CreateIntentItem(entity);
                m_ActiveIntentItem.Add(intentItem);
            }

            intentItem.Init(entity, m_CachedCanvas, sp, value);
        }