Beispiel #1
0
        void refresh()
        {
            BuffData buff;

            for (int i = 0; i < BuffIconImages.Length; i++)
            {
                if (buffDatas.Count > i)
                {
                    buff = buffDatas[i];
                    BuffIconImages[i].gameObject.SetActive(true);
                    BuffIconImages[i].sprite = Statics.GetBuffSprite(((int)buff.Type).ToString());
                    texts[i].text            = ((int)(buff.GetProgress(BattleLogic.Instance.Frame) * buff.Timeout)).ToString();;
                }
                else
                {
                    BuffIconImages[i].gameObject.SetActive(false);
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// 设置buff属性
        /// </summary>
        /// <param name="buffs">Buffs.</param>
        public void SetBuffDatas(List <BuffData> buffs)
        {
            if (BuffIconImages == null)
            {
                return;
            }
            buffDatas = buffs;
            BuffData buff;

            for (int i = 0; i < BuffIconImages.Length; i++)
            {
                if (buffDatas.Count > i)
                {
                    buff = buffDatas[i];
                    BuffIconImages[i].gameObject.SetActive(true);
                    BuffIconImages[i].sprite = Statics.GetBuffSprite(((int)buff.Type).ToString());
                    BuffIconImages[i].GetComponentInChildren <Text>().text = buff.RoundNumber.ToString();;
                }
                else
                {
                    BuffIconImages[i].gameObject.SetActive(false);
                }
            }
        }