//初始化UI void InitUI() { int _frontLevrel = ObjectSelf.GetInstance().GetPlayOldLevel(); int _curLevel = (int)ObjectSelf.GetInstance().Level; _FrontLevel.text = _frontLevrel.ToString(); _CurLevel.text = _curLevel.ToString(); int _power = 0; int _hero = 0; int _bag = 0; //for (int i = _frontLevrel; i < _curLevel; i++) //{ // PlayerTemplate pRow = (PlayerTemplate)DataTemplate.GetInstance().m_PlayerExpTable.getTableData(i); // _power = pRow.getExtraAp() + _cofig.getInitial_ap_upper_limit(); // _hero += pRow.getExtraHeroPackset(); // _bag += pRow.getExtraCommonItemPackset(); //} VipTemplate _vipData = (VipTemplate)DataTemplate.GetInstance().m_VipTable.getTableData(ObjectSelf.GetInstance().VipLevel); GameConfig _cofig = (GameConfig)DataTemplate.GetInstance().m_GameConfig; PlayerTemplate _pRow = (PlayerTemplate)DataTemplate.GetInstance().m_PlayerExpTable.getTableData(_frontLevrel); _power = _pRow.getExtraAp() + _cofig.getInitial_ap_upper_limit() + _vipData.getExtraAp(); _FrontPower.text = _power.ToString(); _CurPower.text = ObjectSelf.GetInstance().ActionPointMax.ToString(); _hero = _cofig.getInitial_hero_packset() + _pRow.getExtraHeroPackset(); _FrontHero.text = _hero.ToString(); _CurHero.text = ObjectSelf.GetInstance().HeroContainerBag.GetHeroBagSizeMax().ToString(); _bag = _cofig.getInitial_common_item_packset() + _pRow.getExtraCommonItemPackset(); _FrontBag.text = _bag.ToString(); _CurBag.text = ObjectSelf.GetInstance().CommonItemContainer.GetBagItemSizeMax().ToString(); int _apRecover = 0; if ((_curLevel - _frontLevrel) > 1) { for (int i = 0; i < (_curLevel - _frontLevrel); i++) { PlayerTemplate _nRow = (PlayerTemplate)DataTemplate.GetInstance().m_PlayerExpTable.getTableData(_curLevel - i); _apRecover += _nRow.getApRecover(); } } else { PlayerTemplate _nRow = (PlayerTemplate)DataTemplate.GetInstance().m_PlayerExpTable.getTableData(_curLevel); _apRecover = _nRow.getApRecover(); } string _text = string.Format(GameUtils.getString("fight_playerlevelup_content1"), _apRecover); m_PromptObjTxt.text = _text; //播放特效 StartCoroutine(PlayEffectRow(0, 1.5f, () => { m_Level.gameObject.SetActive(true); })); StartCoroutine(PlayEffectRow(1, 2.0f, () => { m_Power.gameObject.SetActive(true); })); StartCoroutine(PlayEffectRow(2, 2.5f, () => { m_PowerMax.gameObject.SetActive(true); })); }
//返回背包容器的最大上限 public int GetBagItemSizeMax() { int nInitialSize = DataTemplate.GetInstance().m_GameConfig.getInitial_common_item_packset(); //初始上限 int nCurSizeSum = DataTemplate.GetInstance().m_GameConfig.getCommon_item_packset_per_expand() * ObjectSelf.GetInstance().BagBuyCount; //已购买增加的上限 int nCurLevel = ObjectSelf.GetInstance().Level; PlayerTemplate _row = (PlayerTemplate)DataTemplate.GetInstance().m_PlayerExpTable.getTableData(nCurLevel); int nLeveladdition = _row.getExtraCommonItemPackset();//等级加成 return(nInitialSize + nCurSizeSum + nLeveladdition); }