//获得装备属性 public AttrChange[] getAttrChanges() { List <AttrChange> list = new List <AttrChange>(); int hp = magicWeaponAttrbutes.getMagicWeaponHp(); if (hp != 0) { AttrChange attrHp = new AttrChange(AttrChangeType.HP, hp); list.Add(attrHp); } int attack = magicWeaponAttrbutes.getMagicWeaponAttack(); if (attack != 0) { AttrChange attrAtt = new AttrChange(AttrChangeType.ATTACK, attack); list.Add(attrAtt); } int agi = magicWeaponAttrbutes.getMagicWeaponAgile(); if (agi != 0) { AttrChange attrAgi = new AttrChange(AttrChangeType.AGILE, agi); list.Add(attrAgi); } int mag = magicWeaponAttrbutes.getMagicWeaponMagic(); if (mag != 0) { AttrChange attrMag = new AttrChange(AttrChangeType.MAGIC, mag); list.Add(attrMag); } int def = magicWeaponAttrbutes.getMagicWeaponDefecse(); if (def != 0) { AttrChange attrDef = new AttrChange(AttrChangeType.DEFENSE, def); list.Add(attrDef); } return(list.ToArray()); }
private string updateSprieName(AttrChange ac) { switch (ac.type) { case AttrChangeType.HP: return("attr_hp"); case AttrChangeType.ATTACK: return("attr_attack"); case AttrChangeType.DEFENSE: return("attr_defense"); case AttrChangeType.MAGIC: return("attr_magic"); case AttrChangeType.AGILE: return("attr_agile"); } return(""); }