public bool LevelUpGunRof(int id) { GunInfor gun = GetGunInfor(id); ConfigGunRofRecord nextLevelConfig = ConfigurationManager.instance.gunRof. GetRecordByKeySearch(new Compare2KeySearch <int, int> { key_1 = id, key_2 = gun.damageLevel + 1 }); if (nextLevelConfig == null) { return(false); } int gold = GetCurrentGold(); if (nextLevelConfig.UnlockFee <= gold) { gold -= nextLevelConfig.UnlockFee; gun.rofLevel++; dataModel.UpdateData(DataPath.GOLD, gold); dataModel.UpdateDataDic(DataPath.GUNS, id, gun); return(true); } return(false); }
private void LevelUpStrength() { if (DataAPIController.instance.LevelUpGunRof(enquipId)) { rofCf = rofCfNext; rofCfNext = ConfigurationManager.instance.gunRof. GetRecordByKeySearch(new Compare2KeySearch <int, int> { key_1 = enquipId, key_2 = rofCfNext.Level + 1 });; UpdateMidUI(); } }
private void OnChangeEnquip(object arg0) { enquipId = (int)arg0; GunInfor gunInfor = DataAPIController.instance.GetGunInfor(enquipId); currentGold = DataAPIController.instance.GetCurrentGold(); dmgCf = ConfigurationManager.instance.gunDmg. GetRecordByKeySearch(new Compare2KeySearch <int, int> { key_1 = enquipId, key_2 = gunInfor.damageLevel });; dmgCfNext = ConfigurationManager.instance.gunDmg. GetRecordByKeySearch(new Compare2KeySearch <int, int> { key_1 = enquipId, key_2 = gunInfor.damageLevel + 1 });; rofCf = ConfigurationManager.instance.gunRof. GetRecordByKeySearch(new Compare2KeySearch <int, int> { key_1 = enquipId, key_2 = gunInfor.rofLevel });; rofCfNext = ConfigurationManager.instance.gunRof. GetRecordByKeySearch(new Compare2KeySearch <int, int> { key_1 = enquipId, key_2 = gunInfor.rofLevel + 1 });; if (root == null) { root = GetComponent <DownPanelExtendItem>(); } UpdateDownUI(); UpdateMidUI(); }
public virtual void SetupStart(ConfigGunDamageRecord configDmg, ConfigGunRofRecord configRof) { damage = configDmg.Value; rof = configRof.Value; }