| System/Skill/TreasurePotentialBehaviour.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Skill/TreasurePotentialLevelUpWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Skill/TreasureSkillCell.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Skill/TreasureSkillModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/Skill/TreasureSkillWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
System/Skill/TreasurePotentialBehaviour.cs
@@ -17,6 +17,7 @@ [SerializeField] Image m_PotentialIcon; [SerializeField] Button m_Func; [SerializeField] RedpointBehaviour m_Redpoint; [SerializeField] UIEffect m_UnlockEffect; int skillId = 0; @@ -67,6 +68,16 @@ } } public void StartUnlock() { m_UnlockEffect.Play(); } public void StopUnlock() { m_UnlockEffect.StopImediatly(); } private void OnFunc() { bool isOpen = model.IsPotentialUnlock(skillId); System/Skill/TreasurePotentialLevelUpWin.cs
@@ -29,12 +29,18 @@ [SerializeField] Button m_LevelUp; [SerializeField] Button m_GetWay; [SerializeField] Button m_Close; [SerializeField] UIEffect m_LevelUpEffect; public static int selectPotentialId = 0; TreasureSkillModel model { get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); } } PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } } #region Built-in protected override void BindController() @@ -53,6 +59,7 @@ { Display(); model.skillLevelUpRefresh += SkillLevelUpRefresh; packModel.refreshItemCountEvent += RefreshItemCountEvent; } protected override void OnAfterOpen() @@ -62,6 +69,7 @@ protected override void OnPreClose() { model.skillLevelUpRefresh -= SkillLevelUpRefresh; packModel.refreshItemCountEvent -= RefreshItemCountEvent; } protected override void OnAfterClose() @@ -74,6 +82,7 @@ if (selectPotentialId == id) { Display(); m_LevelUpEffect.Play(); } } @@ -133,12 +142,7 @@ if (!isMax) { var requireSkillConfig = SkillConfig.Get(config.LearnSkillReq); TreasurePotential requirePotential; if (model.TryGetPotential(config.LearnSkillReq, out requirePotential)) { m_Item.SetItem(config.ExAttr4, config.ExAttr5); } m_Item.SetItem(config.ExAttr4, config.ExAttr5); } } @@ -172,6 +176,14 @@ } } private void RefreshItemCountEvent(PackType packType, int arg2, int itemId) { if (packType == PackType.Item && model.skillLevelUpItems.Contains(itemId)) { Display(); } } } } System/Skill/TreasureSkillCell.cs
@@ -43,11 +43,12 @@ var treasureId = treasureModel.GetTreasureBySkillId(skillId); var isSkillUnlock = false; Treasure treasure; if (treasureModel.TryGetTreasure(treasureId, out treasure)) TreasureSkill treasureSkill; if (model.TryGetSkill(skillId, out treasureSkill)) { isSkillUnlock = treasure.state == TreasureState.Collected; isSkillUnlock = treasureSkill.level > 0; m_SkillLevel.text = StringUtility.Contact("LV.", treasureSkill.level); m_Redpoint.redpointId = treasureSkill.redpoint.id; } m_ContainerLock.gameObject.SetActive(!isSkillUnlock); @@ -56,12 +57,7 @@ m_ContainerSelect.gameObject.SetActive(skillId == model.selectSkill); m_SkillLevel.gameObject.SetActive(isSkillUnlock); TreasureSkill treasureSkill; if (model.TryGetSkill(skillId, out treasureSkill)) { m_SkillLevel.text = StringUtility.Contact("LV.", treasureSkill.level); m_Redpoint.redpointId = treasureSkill.redpoint.id; } } void DisplayBase() System/Skill/TreasureSkillModel.cs
@@ -8,7 +8,8 @@ { Dictionary<int, TreasureSkill> treasureSkills = new Dictionary<int, TreasureSkill>(); Dictionary<int, List<int>> jobTreasureSkills = new Dictionary<int, List<int>>(); List<int> skillLevelUpItems = new List<int>(); public List<int> skillLevelUpItems = new List<int>(); int m_SelectSkill; public int selectSkill @@ -368,7 +369,7 @@ foreach (var potential in skill.potentials) { if (requireRemind && funcOpen && if (requireRemind && funcOpen && IsPotentialUnlock(potential.id) && TryLevelUpPotential(potential.id, out error) && skill.level > 0) { System/Skill/TreasureSkillWin.cs
@@ -28,12 +28,20 @@ [SerializeField] Button m_GetWay; [SerializeField] Button m_LevelUp; [SerializeField] RedpointBehaviour m_LevelRedpoint; [SerializeField] UIEffect m_LevelUpEffect; [SerializeField] Transform m_ContainerMax; [SerializeField] TreasurePotentialBehaviour[] m_TreasurePotentials; List<Clock> clocks = new List<Clock>(); TreasureSkillModel model { get { return ModelCenter.Instance.GetModel<TreasureSkillModel>(); } } PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } } #region Built-in @@ -56,6 +64,7 @@ model.treasureSkillRefresh += TreasureSkillRefresh; model.selectRefresh += SelectRefresh; model.skillLevelUpRefresh += SkillLevelUpRefresh; packModel.refreshItemCountEvent += RefreshItemCountEvent; } protected override void OnAfterOpen() @@ -67,7 +76,18 @@ model.treasureSkillRefresh -= TreasureSkillRefresh; model.selectRefresh -= SelectRefresh; model.skillLevelUpRefresh -= SkillLevelUpRefresh; packModel.refreshItemCountEvent -= RefreshItemCountEvent; model.SetAlreadyRemind(); for (int i = 0; i < m_TreasurePotentials.Length; i++) { m_TreasurePotentials[i].StopUnlock(); } foreach (var clock in clocks) { clock.Stop(); } clocks.Clear(); } protected override void OnAfterClose() @@ -108,6 +128,7 @@ { DisplaySkills(); DisplaySkillDetial(); DisplayPotentials(); } private void DisplaySkills() @@ -156,19 +177,28 @@ WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.Daily_EmperorRelic); }); } } } for (int i = 0; i < m_TreasurePotentials.Length; i++) { if (i < skill.potentials.Count) { m_TreasurePotentials[i].gameObject.SetActive(true); m_TreasurePotentials[i].Display(skill.potentials[i].id); } else { m_TreasurePotentials[i].gameObject.SetActive(false); } } private void DisplayPotentials() { for (int i = 0; i < m_TreasurePotentials.Length; i++) { DisplayPotential(i); } } private void DisplayPotential(int index) { TreasureSkill skill; if (!model.TryGetSkill(model.selectSkill, out skill)) { return; } if (index < m_TreasurePotentials.Length) { m_TreasurePotentials[index].gameObject.SetActive(index < skill.potentials.Count); m_TreasurePotentials[index].Display(skill.potentials[index].id); } } @@ -204,8 +234,18 @@ private void SelectRefresh() { for (int i = 0; i < m_TreasurePotentials.Length; i++) { m_TreasurePotentials[i].StopUnlock(); } foreach (var clock in clocks) { clock.Stop(); } clocks.Clear(); m_Controller.m_Scorller.RefreshActiveCellViews(); DisplaySkillDetial(); DisplayPotentials(); } private void SkillLevelUpRefresh(int id) @@ -214,6 +254,51 @@ { m_Controller.m_Scorller.RefreshActiveCellViews(); DisplaySkillDetial(); m_LevelUpEffect.Play(); TreasureSkill skill; if (model.TryGetSkill(model.selectSkill, out skill)) { for (int i = 0; i < skill.potentials.Count; i++) { var index = i; if (index < m_TreasurePotentials.Length && skill.potentials[index].openLevel == skill.level) { m_TreasurePotentials[index].StartUnlock(); Clock clock = null; clock = Clock.Create(1, () => { DisplayPotential(index); if (clock != null && clocks.Contains(clock)) { clocks.Remove(clock); } }); clocks.Add(clock); } } } } else { var skillId = 0; if (model.ContainsSkill(id, out skillId)) { if (skillId == model.selectSkill) { DisplayPotentials(); } } } } private void RefreshItemCountEvent(PackType packType, int arg2, int itemId) { if (packType == PackType.Item && model.skillLevelUpItems.Contains(itemId)) { DisplaySkillDetial(); } } }