| | |
| | | [SerializeField] Star[] m_Stars; |
| | | [SerializeField] ItemCell m_TargetEquip; |
| | | [SerializeField] Text m_EquipStar; |
| | | [SerializeField] EquipStarMaterialSelectButton m_MaterialSelect; |
| | | [SerializeField] EquipStarUpgradeSpecialMaterialBehaviour m_SpecialMaterial; |
| | | [SerializeField] EquipStarUpgradeSpecialMaterialBehaviour m_SpecialMaterial1; |
| | | [SerializeField] EquipStarUpgradeSpecialMaterialBehaviour m_SpecialMaterial2; |
| | | |
| | | [SerializeField] Text m_SuccessRate; |
| | | [SerializeField] RectTransform m_EmptyHint; |
| | | [SerializeField] RectTransform m_PropertyDetails; |
| | | [SerializeField] BaseProperty[] m_BasePropertys; |
| | |
| | | [SerializeField] Button m_StarUpgrade; |
| | | [SerializeField] RectTransform m_MaxStarLevelHint; |
| | | [SerializeField] Button m_Preview; |
| | | [SerializeField] UIEffect m_EffectStarFill; |
| | | [SerializeField] UIEffect m_EffectSuccess; |
| | | [SerializeField] UIEffect m_EffectFailed; |
| | | |
| | | [SerializeField] ToggleButton m_Auto; |
| | | [SerializeField] Text m_AutoMoney; |
| | | [SerializeField] RectTransform m_AutoTextContainer; |
| | | [SerializeField] Text m_UnAutoText; |
| | | [SerializeField] RectTransform m_AutoContainer; |
| | | |
| | | List<EquipStarLevelSelectBehaviour> levelBehaviours = new List<EquipStarLevelSelectBehaviour>(); |
| | |
| | | private void ShowAuto() |
| | | { |
| | | m_Auto.isOn = !m_Auto.isOn; |
| | | if (m_Auto.isOn) |
| | | { |
| | | model.QueryAutoBuy(); |
| | | } |
| | | else |
| | | { |
| | | model.autoBuy.value = -1; |
| | | |
| | | model.CalculateStarUpgradeProbability(new Int2(model.selectedLevel.value, model.selectedPlace.value)); |
| | | } |
| | | model.autoBuy.value = -1; |
| | | } |
| | | |
| | | public void ShowAutoText(int money) |
| | | { |
| | | //"8888自动提升至100%成功率(与全服拍卖同步)" |
| | | //m_LevelLimit.colorType = |
| | | var color = PlayerDatas.Instance.baseData.bindDiamond >= money ? TextColType.Green : TextColType.Red; |
| | | m_AutoMoney.text = Language.Get("StartUpAutoBuy", UIHelper.AppendColor(color, money.ToString(), true)); |
| | | |
| | |
| | | |
| | | private void OnItemCountRefresh(int index) |
| | | { |
| | | //var equipPosition = new Int2(model.selectedLevel.value, model.selectedPlace.value); |
| | | //var currentStarLevel = model.GetEquipStarLevel(equipPosition); |
| | | //model.normalMaterials.Fetch(); |
| | | //DisplayMaterialSlots(equipPosition, currentStarLevel); |
| | | model.normalMaterials.dirty = true; |
| | | model.CalculateStarUpgradeProbability(new Int2(model.selectedLevel.value, model.selectedPlace.value)); |
| | | |
| | | } |
| | | |
| | |
| | | private void DisplayBaseInfo() |
| | | { |
| | | CreateLevelBehaviours(); |
| | | } |
| | | |
| | | private void DisplayerAutoBuy() |
| | | { |
| | | //特殊四件和满星不需要自动购买 |
| | | if (model.equipMaxStarLevel.value == model.equipStarLevel.value) |
| | | { |
| | | m_AutoContainer.SetActive(false); |
| | | m_SuccessRate.text = string.Empty; |
| | | return; |
| | | } |
| | | if (model.selectedPlace.value > 8 && model.selectedPlace.value <= 12) |
| | | { |
| | | m_AutoContainer.SetActive(false); |
| | | model.autoBuy.value = -1; |
| | | var equipPosition = new Int2(model.selectedLevel.value, model.selectedPlace.value); |
| | | var equipGuid = equipModel.GetEquip(equipPosition); |
| | | var equip = packModel.GetItemByGuid(equipGuid); |
| | | if (equip == null) |
| | | { |
| | | m_SuccessRate.text = string.Empty; |
| | | } |
| | | return; |
| | | } |
| | | m_AutoContainer.SetActive(true); |
| | | if (model.autoBuy.value != -1) |
| | | { |
| | | model.QueryAutoBuy(); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | DisplayStars(model.stars.Fetch()); |
| | | } |
| | | |
| | | if (force || model.starUpgradeProbability.dirty) |
| | | { |
| | | if (model.selectedPlace.value > 8 && model.selectedPlace.value <= 12) |
| | | { |
| | | model.autoBuy.value = -1; |
| | | } |
| | | DisplaySuccessRate(model.starUpgradeProbability.Fetch()); |
| | | DisplayerAutoBuy(); |
| | | } |
| | | |
| | | if (force || model.starResultEffect.dirty) |
| | | { |
| | |
| | | PlayStarUpgradeEffect(result); |
| | | } |
| | | |
| | | if (force || model.normalMaterials.dirty) |
| | | { |
| | | var equipPosition = new Int2(model.selectedLevel.value, model.selectedPlace.value); |
| | | var currentStarLevel = model.GetEquipStarLevel(equipPosition); |
| | | model.normalMaterials.Fetch(); |
| | | DisplayMaterialSlots(equipPosition, currentStarLevel); |
| | | } |
| | | |
| | | |
| | | if (force || model.autoBuy.dirty) |
| | | { |
| | | if (model.equipMaxStarLevel.value == model.equipStarLevel.value) |
| | | { |
| | | m_AutoTextContainer.SetActive(false); |
| | | m_UnAutoText.SetActive(false); |
| | | m_SuccessRate.text = string.Empty; |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | //不勾选自动购买 |
| | | m_Auto.isOn = false; |
| | | m_AutoTextContainer.SetActive(false); |
| | | m_UnAutoText.SetActive(true); |
| | | m_UnAutoText.text = Language.Get("StarAutoBuy1"); |
| | | |
| | | } |
| | | else if (value == -2) |
| | | { |
| | | //勾选自动购买 但拍卖行装备不足 |
| | | m_Auto.isOn = true; |
| | | m_AutoTextContainer.SetActive(false); |
| | | m_UnAutoText.SetActive(true); |
| | | m_UnAutoText.text = Language.Get("StarAutoBuy2"); |
| | | DisplaySuccessRate(100); |
| | | ShowAutoText(value); |
| | | } |
| | | else |
| | | { |
| | | m_Auto.isOn = true; |
| | | m_AutoTextContainer.SetActive(true); |
| | | m_UnAutoText.SetActive(false); |
| | | ShowAutoText(value); |
| | | DisplaySuccessRate(100); |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (!upgradable || isMax ) |
| | | { |
| | | m_MaterialSelect.Display(true, 0); |
| | | m_SpecialMaterial.Display(false, 0, 0); |
| | | m_SpecialMaterial1.Display(false, 0, 0); |
| | | m_SpecialMaterial2.Display(false, 0, 0); |
| | | } |
| | | else |
| | | { |
| | | var starConfig = EquipStarConfig.Get(equipPosition.x, equipPosition.y, currentStarLevel + 1); |
| | | var needEquip = starConfig.CostEquipCnt > 0; |
| | | if (needEquip) |
| | | { |
| | | if (model.normalMaterials.Count > 0) |
| | | { |
| | | var item = packModel.GetItemByGuid(model.normalMaterials[0]); |
| | | m_MaterialSelect.Display(false, item != null ? item.itemId : 0); |
| | | } |
| | | else |
| | | { |
| | | m_MaterialSelect.Display(false, 0); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | m_MaterialSelect.Display(true, 0); |
| | | } |
| | | |
| | | m_SpecialMaterial.Display(starConfig.CostItemDict.x != 0, starConfig.CostItemDict.x, starConfig.CostItemDict.y); |
| | | |
| | | m_SpecialMaterial1.Display(starConfig.CostItemDict[0].x != 0, starConfig.CostItemDict[0].x, starConfig.CostItemDict[0].y); |
| | | m_SpecialMaterial2.Display(starConfig.CostItemDict[1].x != 0, starConfig.CostItemDict[1].x, starConfig.CostItemDict[1].y); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | private void DisplaySuccessRate(int successRate) |
| | | { |
| | | if (model.autoBuy.value != -1) successRate = 100; //有勾选即100% |
| | | |
| | | if (successRate >= 0) |
| | | { |
| | | m_SuccessRate.text = Language.Get("EquipStar13", successRate); |
| | | |
| | | if (successRate < 50) |
| | | { |
| | | m_SuccessRate.color = UIHelper.GetUIColor(TextColType.Red, true); |
| | | } |
| | | else if (successRate < 80) |
| | | { |
| | | m_SuccessRate.color = UIHelper.GetUIColor(TextColType.NavyBrown, true); |
| | | } |
| | | else |
| | | { |
| | | m_SuccessRate.color = UIHelper.GetUIColor(TextColType.Green, true); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | m_SuccessRate.text = string.Empty; |
| | | } |
| | | } |
| | | |
| | | |
| | | private void DisplayStarUpgradeButton(Int2 equipPosition, int currentStarLevel) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | IEnumerator Co_PlaySuccessEffect() |
| | | { |
| | | m_EffectStarFill.Play(); |
| | | yield return WaitingForSecondConst.WaitMS700; |
| | | m_EffectSuccess.Play(); |
| | | } |
| | | //IEnumerator Co_PlaySuccessEffect() |
| | | //{ |
| | | // m_EffectStarFill.Play(); |
| | | // yield return WaitingForSecondConst.WaitMS700; |
| | | // m_EffectSuccess.Play(); |
| | | //} |
| | | |
| | | IEnumerator Co_PlayFailedEffect() |
| | | { |
| | | m_EffectStarFill.Play(); |
| | | yield return WaitingForSecondConst.WaitMS700; |
| | | m_EffectFailed.Play(); |
| | | } |
| | | //IEnumerator Co_PlayFailedEffect() |
| | | //{ |
| | | // m_EffectStarFill.Play(); |
| | | // yield return WaitingForSecondConst.WaitMS700; |
| | | // m_EffectFailed.Play(); |
| | | //} |
| | | |
| | | IEnumerator Co_DisplayStars(List<EquipStarModel.Star> stars) |
| | | { |