예제 #1
0
        private void RemoveBuff(BuffBase bf)
        {
            if (!m_BuffList.Contains(bf))
            {
                return;
            }

            m_BuffList.Remove(bf);
            BuffManager.Instance.DestroyBuff(bf);

            //更新其它BUF的位置
            List <BuffBase> temp_buffs = new List <BuffBase>();

            foreach (BuffBase buff_base in m_BuffList)
            {
                if (buff_base.TabBfEffect.EffectPos == (int)BuffPostionType.E_BUFF_POSTION_TYPE_LEFT)
                {
                    temp_buffs.Add(buff_base);
                }
            }

            for (int i = 0; i < temp_buffs.Count && i < m_BuffPosArray.Length; i++)
            {
                temp_buffs[i].BuffObj.transform.localPosition = m_BuffPosArray[i].transform.localPosition;
            }
        }
예제 #2
0
 public void DestroyBuff(BuffBase bf)
 {
     if (bf != null)
     {
         bf.Destroy();
         m_BuffList.Remove(bf);
     }
 }
예제 #3
0
        public void AddBuff(BuffInfo info)
        {
            BuffBase bf = m_BuffList.Find(delegate(BuffBase buf) { return(buf.BuffId == info.buf_id); });

            if (bf == null)
            {
                bf = BuffManager.Instance.CreateBuff(this, info.buf_id, info.buf_value);
                if (bf != null)
                {
                    m_BuffList.Add(bf);
                }
            }
            else
            {
                bf.BuffValue = info.buf_value;
            }
        }