Example #1
0
 public void RefreshData()    //刷新装备数据
 {
     TotalEquips = new StatsBase();
     foreach (Equip equip in onwear)
     {
         if (equip != null)
         {
             TotalEquips.Add(equip.MFProperties);
             TotalEquips.Add(equip.PProperties);
         }
     }
 }
Example #2
0
        IEnumerator BuffRefresh()
        {
            while (true)
            {
                TotalBuff = new StatsBase();

                foreach (Buff buff in Bufflist)
                {
                    TotalBuff.Add(buff.EffectStats);


                    buff.EffectTime--;
                    if (buff.EffectTime <= 0)
                    {
                        Bufflist.Remove(buff);
                    }
                }
                yield return(new WaitForSeconds(1f));
            }
        }
Example #3
0
        public void RefreshData()
        {
            //重新计算装备总值、道具总值、基础总值、buff总值(按顺序)

            PlayerEquipment.RefreshData();                //装备总值
            foreach (StatsBase item in ItemEnternalStats) //道具总值
            {
                TotalItemStats.Add(item);
            }

            RefreshBase(); //基础总值
            //BuffRefresh()周期更新buff总值
            RefreshRecover();
            RefreshStats();

            /*TotalStats = new StatsBase();
             * BaseStats = new StatsBase();
             * TotalItemStats = new StatsBase();
             * TotalIntimeRecover = new StatsIntime();
             * foreach (StatsBase item in ItemEnternalStats)
             * {
             *  TotalItemStats.Add(item);
             * }
             *
             * BaseStats.Add(PlayerStats);
             *
             * BaseStats.Add(TotalItemStats);
             *
             * TotalStats.Add(BaseStats);
             *
             * TotalStats.Add(PlayerEquipment.TotalEquips);
             *
             * TotalIntimeRecover.Add(new StatsIntime(){HpI = TotalStats.HpR + TotalBuffRecover.HpI,MpI = TotalStats.MpR + TotalBuffRecover.MpI});*/

            //TotalIntime.DataCheck(TotalStats);
        }