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;
            }
        }
示例#2
0
        public void Recycle(string poolName, GameObject obj)
        {
            GameObjectPool cell = null;

            if (!m_PoolMap.TryGetValue(poolName, out cell))
            {
                Log.e("Recycle Not Find Pool:" + poolName);
                return;
            }

            cell.Recycle(obj);
        }