//释放
        protected internal override void Release(bool isShutdown)
        {
            HPBarItem hpBarItem = Target as HPBarItem;

            if (hpBarItem == null)
            {
                return;
            }

            Object.Destroy(hpBarItem.ReferenceCollector.CachedGameObject);
        }
        public void Update()
        {
            for (int i = m_ListActiveHPBar.Count - 1; i >= 0; i--)
            {
                HPBarItem hpBarItem = m_ListActiveHPBar[i];
                if (hpBarItem.Refresh())
                {
                    continue;
                }

                HideHPBar(hpBarItem);   //隐藏血条
            }
        }
        //显示实体血条
        public void ShowHPBar(Entity entity, float fromHPRatio, float toHPRatio)
        {
            if (entity == null)
            {
                HotLog.Warning("Entity is invalid.");
                return;
            }

            HPBarItem hpBarItem = GetActiveHPBarItem(entity);

            if (hpBarItem == null)
            {
                hpBarItem = CreateHPbarItem();
                m_ListActiveHPBar.Add(hpBarItem);
            }

            hpBarItem.Init(entity, m_CachedCanvas, fromHPRatio, toHPRatio);
        }
        //创建实体血条
        private HPBarItem CreateHPbarItem()
        {
            HPBarItem hpBarItem;
            //先从对象池获取
            HPBarItemObject hpBarItemObject = m_HPBarItemObjectPool.Spawn();

            if (hpBarItemObject != null)
            {
                hpBarItem = hpBarItemObject.Target as HPBarItem;
            }
            else
            {
                //对象池中不存在,则创建新的
                ReferenceCollector referenceCollector = Object.Instantiate(m_HPBarItemTemplate).GetComponent(typeof(ReferenceCollector)) as ReferenceCollector;
                hpBarItem = new HPBarItem(referenceCollector);

                referenceCollector.CachedTransform.SetParent(m_HPBarInstanceRoot, false);
                m_HPBarItemObjectPool.Register(new HPBarItemObject(hpBarItem), true);
            }

            return(hpBarItem);
        }
 //隐藏血条
 private void HideHPBar(HPBarItem hpBarItem)
 {
     hpBarItem.Reset();
     m_ListActiveHPBar.Remove(hpBarItem);
     m_HPBarItemObjectPool.Unspawn(hpBarItem);
 }