示例#1
0
 public virtual void Dispose()
 {
     if (this.IsFromPool)
     {
         ReferencePool.Recycle(this);
     }
 }
示例#2
0
        public void Release()
        {
            Reset();

            if (null != mIconLoader)
            {
                ReferencePool.Recycle(mIconLoader);
                mIconLoader = null;
            }
        }
示例#3
0
        private void DisposeComponents()
        {
            for (int i = mComponentList.Count - 1; i >= 0; --i)
            {
                var tmpComponent = mComponentList[i];
                tmpComponent.Dispose();
                ReferencePool.Recycle(tmpComponent);
            }

            mComponentList.Clear();
            mComponentDict.Clear();
        }
示例#4
0
            public void Release()
            {
                SkillBase = null;

                if (null != IconLoader)
                {
                    ReferencePool.Recycle(IconLoader);
                    IconLoader = null;
                }

                IconImg.sprite = null;
                SetActive(IconImg, false);
            }
示例#5
0
        private void UpdateComponents(float deltaTime)
        {
            for (int i = mComponentList.Count - 1; i >= 0; --i)
            {
                var tmpComponent = mComponentList[i];

                if (tmpComponent.IsDispose)
                {
                    ReferencePool.Recycle(tmpComponent);
                    mComponentList.RemoveAt(i);
                }
                else
                {
                    tmpComponent.Update(deltaTime);
                }
            }
        }