| | |
| | | [SerializeField] Button m_LeftBtn;
|
| | | [SerializeField] Button m_RightBtn;
|
| | | [SerializeField] List<SkillCell> equipPassSkills = new List<SkillCell>();
|
| | | [SerializeField] List<UIEffect> equipPassEffects = new List<UIEffect>();
|
| | | [SerializeField] Image m_DragImg;
|
| | | [SerializeField] Image m_DragSkillImg;
|
| | | [SerializeField] List<Button> m_PageBtns = new List<Button>();
|
| | | [Header("GetWay")]
|
| | | [SerializeField]
|
| | | Button m_GetWayBtn;
|
| | | [SerializeField] Button m_ImmediatelyUnlock;
|
| | | [SerializeField] ScrollerController scrollerController;
|
| | | [SerializeField] RectTransform m_ContainerGetWay;
|
| | | [SerializeField] ClickScreenOtherSpace clickOtherSpace;
|
| | | [SerializeField, Header("特效时长")] float m_EffectDuration = 1f;
|
| | | private List<SkillConfig> skillListPass = new List<SkillConfig>();
|
| | | private int presentSltEquipIndex = -1;
|
| | | Coroutine cacheCoroutine = null;
|
| | | SkillModel m_Model;
|
| | | SkillModel model
|
| | | {
|
| | |
| | | return m_Model ?? (m_Model = ModelCenter.Instance.GetModel<SkillModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | PlayerTaskDatas task { get { return ModelCenter.Instance.GetModel<PlayerTaskDatas>(); } }
|
| | |
|
| | | RolePromoteModel m_PromoteModel;
|
| | | RolePromoteModel promoteModel
|
| | |
| | | return m_VipModel ?? (m_VipModel = ModelCenter.Instance.GetModel<VipModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | PlayerMainDate taskMain { get { return ModelCenter.Instance.GetModel<PlayerMainDate>(); } }
|
| | | PlayerPackModel pack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | |
|
| | | static readonly Color equipHoleLimitColor = new Color32(250, 3, 3, 255);
|
| | | static readonly Color equipHoleUnLimitColor = new Color32(51, 8, 0, 255);
|
| | |
| | | }
|
| | | scrollerController.OnRefreshCell += OnRefreshCell;
|
| | | m_GetWayBtn.onClick.AddListener(OnGetWayBtn);
|
| | | m_ImmediatelyUnlock.onClick.AddListener(ImmediatelyUnlock);
|
| | | clickOtherSpace.AddListener(() =>
|
| | | {
|
| | | m_ContainerGetWay.gameObject.SetActive(false);
|
| | |
| | | m_DragImg.gameObject.SetActive(false);
|
| | | m_ContainerGetWay.gameObject.SetActive(false);
|
| | | m_GetWayBtn.gameObject.SetActive(false);
|
| | | m_ImmediatelyUnlock.gameObject.SetActive(false);
|
| | | flipScroll.locked = false;
|
| | | PlayerSkillDatas.OnRefreshSkill += OnRefreshSkill;
|
| | | model.OnRefreshSltSkill += OnRefreshSltSkill;
|
| | |
| | | UpdateEquipPassSkill();
|
| | | SetEquipHoleSelect(GetEquipHoleIndex(model.presentSltSkillID));
|
| | | DayRemind.Instance.SetDayRemind(DayRemind.PASS_SKILL_REDPOINT, true);
|
| | |
|
| | | if (cacheCoroutine != null)
|
| | | {
|
| | | StopCoroutine(cacheCoroutine);
|
| | | cacheCoroutine = null;
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | UpdatePageBtn();
|
| | |
|
| | | if (model.taskHoleRedpoint.state == RedPointState.Simple)
|
| | | {
|
| | | model.SetTaskHoleRemind();
|
| | | for (int i = 0; i < equipPassSkills.Count; i++)
|
| | | {
|
| | | PassSkillLimit limit;
|
| | | if (model.TryGetPassSkillLimit(i, out limit))
|
| | | {
|
| | | if (limit.OpenSkillSlots > 0
|
| | | && model.taskHoleDict[limit.OpenSkillSlots] == model.immediatelyUnlockTask)
|
| | | {
|
| | | OnClickEquipHole(i, false);
|
| | | return;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | DisplayEffect();
|
| | | model.taskUnlockUpdate += TaskUnlockUpdate;
|
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | |
| | | model.OnRefreshSltSkill -= OnRefreshSltSkill;
|
| | | model.UpdatePassEquipSkillEvent -= UpdatePassEquipSkillEvent;
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent -= OnRefreshPlayerInfo;
|
| | | model.taskUnlockUpdate -= TaskUnlockUpdate;
|
| | | model.SetDayRemind();
|
| | | model.UnlockPassHole = 0;
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | | model.SendEquipPage();
|
| | | }
|
| | |
|
| | | private void TaskUnlockUpdate()
|
| | | {
|
| | | DisplayEffect();
|
| | | }
|
| | |
|
| | | void DisplayEffect()
|
| | | {
|
| | | if (model.UnlockPassHole != 0)
|
| | | {
|
| | | var index = 0;
|
| | | for (int i = 0; i < equipPassSkills.Count; i++)
|
| | | {
|
| | | PassSkillLimit limit;
|
| | | if (model.TryGetPassSkillLimit(i, out limit))
|
| | | {
|
| | | if (limit.OpenSkillSlots != 0 && limit.OpenSkillSlots == model.UnlockPassHole)
|
| | | {
|
| | | index = i;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | model.UnlockPassHole = 0;
|
| | | if (index >= 0 && index < equipPassEffects.Count)
|
| | | {
|
| | | equipPassEffects[index].Play();
|
| | | cacheCoroutine = StartCoroutine(Co_UnlockEffectComplete());
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | IEnumerator Co_UnlockEffectComplete()
|
| | | {
|
| | | var duration = m_EffectDuration > 0f ? m_EffectDuration : 1.0f;
|
| | | yield return WaitingForSecondConst.GetWaitForSeconds(duration);
|
| | | SysNotifyMgr.Instance.ShowTip("PassNewHole");
|
| | | UpdateEquipPassSkill();
|
| | | }
|
| | |
|
| | | protected override void LateUpdate()
|
| | |
| | | flipScroll.RefreshActive();
|
| | | var _equipIndex = GetEquipHoleIndex(model.presentSltSkillID);
|
| | | SetEquipHoleSelect(_equipIndex);
|
| | | m_GetWayBtn.gameObject.SetActive(CheckOpenGetWays(_equipIndex));
|
| | | m_GetWayBtn.gameObject.SetActive(CheckOpenGetWays(_equipIndex) == 1);
|
| | | m_ImmediatelyUnlock.gameObject.SetActive(CheckOpenGetWays(_equipIndex) == 2);
|
| | | OnUpdateSltSkillInfo();
|
| | | }
|
| | |
|
| | | private bool CheckOpenGetWays(int _index)
|
| | | private int CheckOpenGetWays(int _index)
|
| | | {
|
| | | PassSkillLimit _limit;
|
| | | if (model.TryGetPassSkillLimit(_index, out _limit))
|
| | | {
|
| | | if (_limit.level > 0 && PlayerDatas.Instance.baseData.LV < _limit.level)
|
| | | {
|
| | | return true;
|
| | | return 1;
|
| | | }
|
| | | else if (_limit.vipLv > 0 && PlayerDatas.Instance.baseData.VIPLv < _limit.vipLv)
|
| | | {
|
| | | return true;
|
| | | return 1;
|
| | | }
|
| | | else if (_limit.MountLv > 0 && promoteModel.GetMountTotallv() < _limit.MountLv)
|
| | | {
|
| | | return true;
|
| | | return 1;
|
| | | }
|
| | | else if (_limit.OpenSkillSlots > 0 && !model.IsTaskHoleUnlock(_limit.OpenSkillSlots))
|
| | | {
|
| | | if (model.taskHoleDict.ContainsKey(_limit.OpenSkillSlots))
|
| | | {
|
| | | var taskId = model.taskHoleDict[_limit.OpenSkillSlots];
|
| | | var config = Config.Instance.Get<PyTaskConfig>(taskId);
|
| | | if (PlayerDatas.Instance.baseData.LV >= config.lv
|
| | | && taskId == model.immediatelyUnlockTask)
|
| | | {
|
| | | return 2;
|
| | | }
|
| | | }
|
| | | return 3;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | return 0;
|
| | | }
|
| | |
|
| | | private void OnRefreshPlayerInfo(PlayerDataRefresh type)
|
| | |
| | | continue;
|
| | | }
|
| | | }
|
| | | else if (limit.OpenSkillSlots > 0)
|
| | | {
|
| | | if (!model.IsTaskHoleUnlock(limit.OpenSkillSlots) || model.UnlockPassHole == limit.OpenSkillSlots)
|
| | | {
|
| | | SetEquipSkillDeActive(i);
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.color = equipHoleLimitColor;
|
| | |
|
| | | if (model.taskHoleDict.ContainsKey(limit.OpenSkillSlots))
|
| | | {
|
| | | var taskId = model.taskHoleDict[limit.OpenSkillSlots];
|
| | | var config = Config.Instance.Get<PyTaskConfig>(taskId);
|
| | | if (PlayerDatas.Instance.baseData.LV < config.lv)
|
| | | {
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.text =
|
| | | UIHelper.ReplaceNewLine(Language.Get("PassSkillHoleLimitTask_6", config.lv));
|
| | | continue;
|
| | | }
|
| | | }
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.text =
|
| | | UIHelper.ReplaceNewLine(Language.Get(StringUtility.Contact("PassSkillHoleLimitTask_", limit.OpenSkillSlots)));
|
| | | continue;
|
| | | }
|
| | | else if (model.taskHoleDict[limit.OpenSkillSlots] == model.immediatelyUnlockTask
|
| | | && model.IsTaskHoleUnlock(limit.OpenSkillSlots))
|
| | | {
|
| | | if (m_ImmediatelyUnlock.gameObject.activeSelf)
|
| | | {
|
| | | m_ImmediatelyUnlock.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | int _skillId = 0;
|
| | | equipPassSkills[i].skillData.m_SkillNameTxt.text = string.Empty;
|
| | |
| | | var dis = Vector3.Distance(des.center, src.center);
|
| | | if (dis < rect.rect.width / 2)
|
| | | {
|
| | | if (CheckOpenGetWays(i))
|
| | | if (CheckOpenGetWays(i) != 0)
|
| | | {
|
| | | //SoundPlayer.Instance.PlayUIAudio(2);
|
| | | return;
|
| | |
| | | UpdatePassEquipPageBtn();
|
| | | var _equipIndex = GetEquipHoleIndex(model.presentSltSkillID);
|
| | | SetEquipHoleSelect(_equipIndex);
|
| | | m_GetWayBtn.gameObject.SetActive(CheckOpenGetWays(_equipIndex));
|
| | | m_GetWayBtn.gameObject.SetActive(CheckOpenGetWays(_equipIndex) == 1);
|
| | | m_ImmediatelyUnlock.gameObject.SetActive(CheckOpenGetWays(_equipIndex) == 2);
|
| | | }
|
| | |
|
| | | private void UpdatePassEquipPageBtn()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void OnClickEquipHole(int index)
|
| | | private void OnClickEquipHole(int index, bool requireRemind = true)
|
| | | {
|
| | | PassSkillLimit limit;
|
| | | m_GetWayBtn.gameObject.SetActive(false);
|
| | | m_ImmediatelyUnlock.gameObject.SetActive(false);
|
| | | SetEquipHoleSelect(index);
|
| | | if (model.TryGetPassSkillLimit(index, out limit))
|
| | | {
|
| | |
| | | {
|
| | | if (PlayerDatas.Instance.baseData.LV < limit.level)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("PassEquipLimitLevel", limit.level);
|
| | | if (requireRemind)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("PassEquipLimitLevel", limit.level);
|
| | | }
|
| | | m_GetWayBtn.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | if (PlayerDatas.Instance.baseData.VIPLv < limit.vipLv)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("PassEquipLimitVip", limit.vipLv);
|
| | | if (requireRemind)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("PassEquipLimitVip", limit.vipLv);
|
| | | }
|
| | | m_GetWayBtn.gameObject.SetActive(true);
|
| | | return;
|
| | | }
|
| | |
| | | {
|
| | | if (promoteModel.GetMountTotallv() < limit.MountLv)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("PassEquipLimitMountLevel", limit.MountLv);
|
| | | if (requireRemind)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("PassEquipLimitMountLevel", limit.MountLv);
|
| | | }
|
| | | m_GetWayBtn.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | | else if (limit.OpenSkillSlots > 0)
|
| | | {
|
| | | if (!model.IsTaskHoleUnlock(limit.OpenSkillSlots))
|
| | | {
|
| | | if (model.taskHoleDict.ContainsKey(limit.OpenSkillSlots))
|
| | | {
|
| | | var taskId = model.taskHoleDict[limit.OpenSkillSlots];
|
| | | var config = Config.Instance.Get<PyTaskConfig>(taskId);
|
| | | if (PlayerDatas.Instance.baseData.LV < config.lv)
|
| | | {
|
| | | m_GetWayBtn.gameObject.SetActive(false);
|
| | | return;
|
| | | }
|
| | | if (taskId == model.immediatelyUnlockTask)
|
| | | {
|
| | | m_ImmediatelyUnlock.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | | if (requireRemind)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip(StringUtility.Contact("PassSkillHoleLimitTask_", limit.OpenSkillSlots));
|
| | | }
|
| | | m_GetWayBtn.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | m_ContainerGetWay.gameObject.SetActive(true);
|
| | | }
|
| | |
|
| | | void ImmediatelyUnlock()
|
| | | {
|
| | | var count = pack.GetItemCountByID(PackType.rptItem, taskMain.ItemID);
|
| | | if (count >= taskMain.ItemNumber)
|
| | | {
|
| | | task.CompletionOfTask(model.immediatelyUnlockTask);
|
| | | }
|
| | | else
|
| | | {
|
| | | var requireJade = (ulong)((taskMain.ItemNumber - count) * taskMain.UnitPrice);
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("PassiveSkillTask3", requireJade), |
| | | (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | if (UIHelper.GetMoneyCnt(1) >= requireJade)
|
| | | {
|
| | | task.CompletionOfTask(model.immediatelyUnlockTask);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnClickFunc(CellView cell)
|
| | | {
|
| | | WindowJumpMgr.Instance.WindowJumpTo((JumpUIType)cell.index);
|