Ejemplo n.º 1
0
    public bool LevelUpGunDamage(int id)
    {
        GunInfor gun = GetGunInfor(id);

        ConfigGunDamageRecord nextLevelConfig =
            ConfigurationManager.instance.gunDmg.
            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.damageLevel++;
            dataModel.UpdateData(DataPath.GOLD, gold);
            dataModel.UpdateDataDic(DataPath.GUNS, id, gun);
            return(true);
        }

        return(false);
    }
Ejemplo n.º 2
0
 private void LevelUpFirePower()
 {
     if (DataAPIController.instance.LevelUpGunDamage(enquipId))
     {
         dmgCf     = dmgCfNext;
         dmgCfNext = ConfigurationManager.instance.gunDmg.
                     GetRecordByKeySearch(new Compare2KeySearch <int, int>
         {
             key_1 = enquipId, key_2 = dmgCfNext.Level + 1
         });;
         UpdateDownUI();
     }
 }
Ejemplo n.º 3
0
    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();
    }
Ejemplo n.º 4
0
 public virtual void SetupStart(ConfigGunDamageRecord configDmg, ConfigGunRofRecord configRof)
 {
     damage = configDmg.Value;
     rof    = configRof.Value;
 }