private void ShowMsg(FloatMsg msgVo, bool check = true) { if (check) { if (!CheckIsShowAble()) { m_MsgList.Push(msgVo); return; } } GameObject obj = m_GameObjectPool.Allocate(); if (obj) { FloatMessageItem item = obj.GetComponent <FloatMessageItem>(); item.SetFloatMsg(msgVo); obj.transform.SetParent(m_Root, true); obj.transform.localPosition = m_StartPos; Tweener tweener = obj.transform.DOLocalMove(m_EndPos, m_AnimTime); tweener.SetEase(Ease.Linear); tweener.OnComplete <Tweener>(() => { m_GameObjectPool.Recycle(obj); }); m_LastSendTime = Time.realtimeSinceStartup; } }
public GameObject Allocate(string poolName) { GameObjectPool cell = null; if (!m_PoolMap.TryGetValue(poolName, out cell)) { Log.e("Allocate Not Find Pool:" + poolName); return(null); } return(cell.Allocate()); }