/** 更新button */ public void UpdateButton() { if (stateType == ButtonStateType.Lock) { storeButton.gameObject.SetActive(false); storeChoose.gameObject.SetActive(true); StarSoulManager manager = StarSoulManager.Instance; bool isExist = manager.checkLockState(starSoul.uid); if (isExist) { storeChoose.value = manager.getLockState(starSoul.uid); } else { storeChoose.value = starSoul.checkState(EquipStateType.LOCKED); } } else if (stateType == ButtonStateType.CHANGE) { if (starSoul.checkState(EquipStateType.OCCUPY) || starSoul.checkState(EquipStateType.LOCKED)) // 装备中或者锁定中转化经验不显示勾选框 { storeButton.gameObject.SetActive(false); storeChoose.gameObject.SetActive(false); storeChoose.value = false; } else { StarSoulManager manager = StarSoulManager.Instance; storeButton.gameObject.SetActive(false); storeChoose.gameObject.SetActive(true); if (isSelect) { if (starSoul.getQualityId() <= GameManager.Instance.starSoulOneKeySelectValue) { StarSoulManager.Instance.setChangeExpState(starSoul.uid, true); } } if (starSoul.getStarSoulType() == 0) { StarSoulManager.Instance.setChangeExpState(starSoul.uid, true); } storeChoose.value = manager.getChangeExpState(starSoul.uid); } } else { storeButton.gameObject.SetActive(true); storeChoose.gameObject.SetActive(false); storeButton.UpdateSoul(starSoul, stateType); } }
/// <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())+")"; // } }
/** 更新星魂视图 */ private void UpdateStarSoulView(StarSoul starsoulView) { if (customIconPoint == null) { return; } backGround.spriteName = "iconback_3"; icon.gameObject.SetActive(false); customIconPoint.SetActive(true); if (customIconPoint.transform.childCount > 0) { Utils.RemoveAllChild(customIconPoint.transform); } ResourcesManager.Instance.LoadAssetBundleTexture(ResourcesManager.STARSOUL_ICONPREFAB_PATH + starsoulView.getIconId(), customIconPoint.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(starsoulView.getQualityId()); } } }); if (starsoulView.isNew) { spriteScrap.gameObject.SetActive(true); if (fatherWindow.name == "StarSoulWindow") { spriteScrap.transform.localPosition = new Vector3(-48f, 67f, 0); spriteScrap.width = 65; spriteScrap.height = 66; } spriteScrap.spriteName = "new3"; } else { spriteScrap.gameObject.SetActive(false); } if (starsoulView.checkState(EquipStateType.LOCKED)) { if (rightBottomSprite != null) { rightBottomSprite.gameObject.SetActive(true); rightBottomSprite.transform.localScale = new Vector3(1, 2, 1); rightBottomSprite.spriteName = "lock"; } } else { if (rightBottomSprite != null) { rightBottomSprite.gameObject.SetActive(false); } } if (iconType == BOTTOM_TEXT_NAME) { rightBottomText.gameObject.SetActive(true); //rightBottomText.text = QualityManagerment.getQualityColor(starsoulView.getQualityId()) + starsoulView.getName (); rightBottomText.text = starsoulView.getName(); } else if (iconType == BOTTOM_TEXT_NAME_LV) { rightBottomText.gameObject.SetActive(true); //rightBottomText.text = QualityManagerment.getQualityColor(starsoulView.getQualityId()) + starsoulView.getName () +"[FFFFFF]"+"Lv."+starsoulView.getLevel(); rightBottomText.text = starsoulView.getName() + "[FFFFFF]" + "Lv." + starsoulView.getLevel(); } else if (iconType == BOTTOM_TEXT_NUM) { rightBottomText.gameObject.SetActive(true); rightBottomText.text = "x" + count; } else { rightBottomText.text = ""; rightBottomText.gameObject.SetActive(false); } }