protected override void Release(bool isShutdown) { IntentItem intentItem = (IntentItem)Target; if (intentItem == null) { return; } Object.Destroy(intentItem.gameObject); }
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); }
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); }