Пример #1
0
        }          //等级更新

        public void UpdateItem(TmEntity entity)
        {
            TmSkill      inventory  = entity.GetComponent <TmSkill>();
            TmProperty   property   = entity.GetComponent <TmProperty>();
            TmChangeType changeType = entity.GetComponent <TmChangeType>();

            switch (inventory.InfoType)
            {
            case (InfoType.Brains):
                property.Stamina += (int)(inventory.Stamina * (changeType.Level + 1));
                property.Brains  += (int)(inventory.Brains * (changeType.Level + 1));
                break;

            case (InfoType.Power):
                property.Stamina += (int)(inventory.Stamina * (changeType.Level + 1));
                property.Power   += (int)(inventory.Power * (changeType.Level + 1));
                break;

            case (InfoType.Bp):
                property.Bp += (int)(inventory.Bp * (changeType.Level + 1));
                break;

            case (InfoType.Ap):
                property.Ap += (int)(inventory.Ap * (changeType.Level + 1));
                break;
            }
        }
Пример #2
0
 void PropertyInit(TmEntity entity)
 {
     if (entity.GetComponent <TmSouler>() != null && entity.GetComponent <TmProperty>() != null && entity.GetComponent <TmChangeType>() != null)
     {
         TmChangeType changeType = entity.GetComponent <TmChangeType>();
         TmProperty   property   = entity.GetComponent <TmProperty>();
         if (property.Hp != changeType.changeCount)
         {
             InitProperty(entity);
             changeType.changeCount = property.Hp;
         }
     }
 }
Пример #3
0
 void PropertyInit(TmEntity entity)
 {
     if (entity.GetComponent <TmSkill>() != null && entity.GetComponent <TmProperty>() != null && entity.GetComponent <TmChangeType>() != null)
     {
         TmSkill      skill      = entity.GetComponent <TmSkill>();
         TmProperty   property   = entity.GetComponent <TmProperty>();
         TmChangeType changeType = entity.GetComponent <TmChangeType>();
         if (changeType.Exp != changeType.changeCount)
         {
             InitProperty(entity);
             changeType.changeCount = changeType.Exp;
         }
     }
 }