public void InitShow() { goldTxt.text = playerData.GetInstance().baginfo.gold.ToString( ); jewelTxt.text = playerData.GetInstance().baginfo.diamond.ToString(); if (FSDataNodeTable <PlayerLevelUpNode> .GetSingleton().DataNodeList != null && playerData.GetInstance().selfData != null && FSDataNodeTable <PlayerLevelUpNode> .GetSingleton().DataNodeList.ContainsKey(playerData.GetInstance().selfData.level)) { PlayerLevelUpNode levelNode = FSDataNodeTable <PlayerLevelUpNode> .GetSingleton().DataNodeList[playerData.GetInstance().selfData.level]; if (levelNode != null) { if (playerData.GetInstance().baginfo.strength > levelNode.maxPower) { energyTxt.text = "[5eaeff]" + playerData.GetInstance().baginfo.strength + "[-]" + "/" + levelNode.maxPower; } else { energyTxt.text = playerData.GetInstance().baginfo.strength + "/" + levelNode.maxPower; } if (playerData.GetInstance().baginfo.vitality > levelNode.maxVitality) { vitalityTxt.text = "[00ffff]" + playerData.GetInstance().baginfo.vitality + "[-]" + "/" + levelNode.maxVitality; } else { vitalityTxt.text = playerData.GetInstance().baginfo.vitality + "/" + levelNode.maxVitality; } } } playerData.GetInstance().ChangeActionPointCeilingHandler(); }
public void UpGrade(float start, float interval, ItemNodeState itemNode, PlayerLevelUpNode PlayerNode) { countss = currentEXP; exp = itemNode.exp_gain; expDiffe = Convert.ToInt32(itemNode.exp_gain / 25); playerNode = PlayerNode; InvokeRepeating("OnSecondFunction", start, interval); }
public void ResetData() { mStartTime = Auxiliary.GetNowTime(); mcount = 1; isCanReborn = false; PlayerLevelUpNode levelupnode = FSDataNodeTable <PlayerLevelUpNode> .GetSingleton().DataNodeList[playerData.GetInstance().selfData.level]; if (levelupnode != null) { needcd = (uint)(levelupnode.resurrection_cd); } }
void ShowPlayerInfo() { playerlvl.text = playerData.GetInstance().selfData.level + "级"; playerName.text = playerData.GetInstance().selfData.playeName; addGold.text = "+" + GameLibrary.receiveGolds; if (addEXP != null && sceneNode != null) { addEXP.text = "+" + sceneNode.power_cost; } PlayerLevelUpNode playerNode = FSDataNodeTable <PlayerLevelUpNode> .GetSingleton().FindDataByType(playerData.GetInstance().selfData.level); playerEXP.value = (float)playerData.GetInstance().selfData.exprience / playerNode.exp; }
int expDiffe;//经验差值 #endregion /// <summary> /// item初始化函数 /// </summary> protected override void InitItem() { hd_ins = UI_HeroDetail.instance; //初始化 mailBtn = transform.Find("MailBtn").GetComponent <UIButton>(); UIEventListener.Get(mailBtn.gameObject).onClick += OnBtnClick; UIEventListener.Get(mailBtn.gameObject).onPress += OnPressBtnClick; count = transform.Find("Count").GetComponent <UILabel>(); hd = playerData.GetInstance().GetHeroDataByID(Globe.selectHero.hero_id); hero = hd.node; playerNode = FSDataNodeTable <PlayerLevelUpNode> .GetSingleton().FindDataByType(playerData.GetInstance().selfData.level); }
protected override void Init() { base.Init(); mask.gameObject.SetActive(false); //upgradeBtn.onClick = OnUpgradeBtnClick; UIEventListener.Get(aKeyUpgradeBtn.gameObject).onClick = OnAKeyUpgradeBtnClick; //UIEventListener.Get(backBtn.gameObject).onClick = OnBackBtnClick; hd_ins = UI_HeroDetail.instance; playerNode = FSDataNodeTable <PlayerLevelUpNode> .GetSingleton().FindDataByType(playerData.GetInstance().selfData.level); }
void UpGrade(ref int current, ref int max, ref int lvl, bool isPlayer) { if (current >= max) { PlayerLevelUpNode playerNode = FSDataNodeTable <PlayerLevelUpNode> .GetSingleton().FindDataByType(!isPlayer ? playerData.GetInstance().selfData.level : lvl); if (null == playerNode) { return; } if (!isPlayer) { if (lvl >= playerNode.heroLvLimit) { current = max; return; } } current -= max; lvl++; if (isPlayer) { max = playerNode.exp; } else { HeroUpGradeNode node = FSDataNodeTable <HeroUpGradeNode> .GetSingleton().FindDataByType(lvl); if (null == node) { return; } max = node.exp; } if (current >= max) { UpGrade(ref current, ref max, ref lvl, isPlayer); } else { return; } } }