Пример #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);
        }