/// <summary> /// 强化星魂通讯读取处理 /// </summary> /// <param name="message">Message.</param> private void doStrengStarSoul(ErlKVMessage message) { ErlType erlType = message.getValue("value") as ErlType; if (erlType is ErlArray) { ErlArray arr = erlType as ErlArray; int index = 0; string uid = arr.Value [index++].getValueString(); long exp = StringKit.toLong(arr.Value [index++].getValueString()); StorageManagerment smanager = StorageManagerment.Instance; StarSoulManager manager = StarSoulManager.Instance; StarSoul starSoul = smanager.getStarSoul(uid); if (starSoul != null) { manager.delStarSoulExp(exp); starSoul.updateExp(starSoul.getEXP() + exp); starSoul.isNew = false; } StorageManagerment.Instance.starSoulStorageVersion++; if (callback != null) { callback(); callback = null; } } else { UiManager.Instance.openDialogWindow <MessageWindow> ((win) => { win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, erlType.getValueString(), null); }); } }
/** 更新UI */ public void updateUI() { updateLabel(); updateStarSoulView(); reserveExp.text = StarSoulManager.Instance.getStarSoulExp().ToString(); long needExpforOne = starSoul.getEXPUp() - starSoul.getEXP(); long needExpforAll = starSoul.getMaxExp() - starSoul.getEXP(); oneLvExp.text = LanguageConfigManager.Instance.getLanguage("StarSoulStrengWindow_DecThree", needExpforOne.ToString()); allLVExp.text = LanguageConfigManager.Instance.getLanguage("StarSoulStrengWindow_DecFour", needExpforAll.ToString()); expLabel.text = EXPSampleManager.Instance.getExpBarShow(starSoul.getEXPSid(), starSoul.getEXP()); starNameLV.text = starSoul.getName() + " Lv." + starSoul.getLevel(); string[] str = starSoul.getDescribe().Split('#'); if (str.Length > 1) { starInfo1.text = str[0].Split('+')[0] + "[3A9663] +" + str[0].Split('+')[1]; starInfo.text = str[1].Split('+')[0] + "[3A9663] +" + str[1].Split('+')[1]; } else { starInfo1.text = str[0].Split('+')[0] + "[3A9663] +" + str[0].Split('+')[1]; } //starInfo.text = starSoul.getDescribe ().Split('+')[0]+"[3A9663] +"+starSoul.getDescribe().Split('+')[1]; long storeExp = StarSoulManager.Instance.getStarSoulExp(); if (storeExp == 0 || starSoul.isMaxLevel()) { allUpButton.disableButton(true); oneUpButton.disableButton(true); } else { // 升一级需要的经验 long needExp = starSoul.getEXPUp() - starSoul.getEXP(); if (storeExp < needExp) { oneUpButton.disableButton(true); } else { oneUpButton.disableButton(false); } allUpButton.disableButton(false); } }
/** 初始化新经验条 */ private LevelupInfo createLevelupInfo(StarSoul oldStarSoul, StarSoul newStarSoul) { LevelupInfo levelupInfo = new LevelupInfo(); levelupInfo.newExp = newStarSoul.getEXP(); levelupInfo.newExpDown = EXPSampleManager.Instance.getEXPDown(newStarSoul.getEXPSid(), newStarSoul.getLevel()); levelupInfo.newExpUp = EXPSampleManager.Instance.getEXPUp(newStarSoul.getEXPSid(), newStarSoul.getLevel()); levelupInfo.newLevel = newStarSoul.getLevel(); levelupInfo.oldExp = oldStarSoul.getEXP(); levelupInfo.oldExpDown = EXPSampleManager.Instance.getEXPDown(oldStarSoul.getEXPSid(), oldStarSoul.getLevel()); levelupInfo.oldExpUp = EXPSampleManager.Instance.getEXPUp(oldStarSoul.getEXPSid(), oldStarSoul.getLevel()); levelupInfo.oldLevel = oldStarSoul.getLevel(); return(levelupInfo); }
public void starSoulIndefity() { StorageManagerment smanager = StorageManagerment.Instance; StarSoulManager manager = StarSoulManager.Instance; StarSoul starSoul = smanager.getStarSoul(indetify_uid); if (starSoul != null) { manager.delStarSoulExp(exp); starSoul.updateExp(starSoul.getEXP()); starSoul.isNew = false; } StorageManagerment.Instance.starSoulStorageVersion++; init(starSoul); }
/// <summary> /// 更新星魂信息 /// </summary> public void updateStarSoul() { levelValueLabel.text = starSoul.getLevel() + "/" + starSoul.getMaxLevel(); starSoulNameLabel.text = QualityManagerment.getQualityColor(starSoul.getQualityId()) + starSoul.getName(); long currentLvExp = EXPSampleManager.Instance.getNowEXPShow(starSoul.getEXPSid(), starSoul.getEXP()); long currentLvMaxEXP = EXPSampleManager.Instance.getMaxEXPShow(starSoul.getEXPSid(), starSoul.getEXP()); if (starSoul.isMaxLevel()) { expBar.updateValue(currentLvMaxEXP, currentLvMaxEXP); } else { expBar.updateValue(currentLvExp, currentLvMaxEXP); } expLabel.text = EXPSampleManager.Instance.getExpBarShow(starSoul.getEXPSid(), starSoul.getEXP()); if (starSoul.checkState(EquipStateType.LOCKED)) { lockSprite.gameObject.SetActive(true); } else { lockSprite.gameObject.SetActive(false); } ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.STARSOUL_ICONPREFAB_PATH + starSoul.getIconId(), starSoulViewPoint.transform, (obj) => { GameObject gameObj = obj as GameObject; if (gameObj != null) { Transform childTrans = gameObj.transform; if (childTrans != null) { StarSoulEffectCtrl effectCtrl = childTrans.gameObject.GetComponent <StarSoulEffectCtrl>(); effectCtrl.setColor(starSoul.getQualityId()); } } }); string[] str = starSoul.getDescribe().Split('#'); if (str.Length > 1) { attrDescLabel.text = "[A65644]" + str[0].Replace("+", "[3A9663]+"); attrDescLabel1.text = "[A65644]" + str[1].Replace("+", "[3A9663]+"); } else { attrDescLabel1.text = "[A65644]" + str[0].Replace("+", "[3A9663]+"); } int partNum = 0; if (currentCard != null) { partNum = currentCard.getStarSoulsPartNum(starSoul.partId); } // 刻印暂时没有开放 // StarSoulSuitSample starSoulSuitSample=starSoul.getStarSoulSuitSample (); // int needNum = starSoulSuitSample.parts.Length; // if (partNum>=needNum) { // // 策划文档上还有个龙之刻印:2分是什么东西??? // suitDescLabel.text = "[FFFFFF]"+starSoulSuitSample.name+": "+starSoulSuitSample.desc; // } else { // suitDescLabel.text = "[999999]"+starSoulSuitSample.name+"("+LanguageConfigManager.Instance.getLanguage("StarSoulWindow_Suit_NotAcitve")+"): "+starSoulSuitSample.desc+"("+ // LanguageConfigManager.Instance.getLanguage("StarSoulWindow_Suit_Acitve_Desc",needNum.ToString())+")"; // } }