| | |
| | | using System; |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using TableConfig;
|
| | | using UnityEngine; |
| | | using UnityEngine.UI; |
| | | |
| | |
| | | |
| | | public class SkillTaskWin : Window |
| | | { |
| | | |
| | | [SerializeField] RichText m_Text_Condition_1;//条件 |
| | | [SerializeField] RichText m_Text_Reward_1;//奖励 |
| | | [SerializeField] Text m_NeedMoney_Text;//所需仙玉 |
| | | [SerializeField] Button m_GoToSkillBtn;
|
| | | [SerializeField] Button m_OpenNowBtn;
|
| | | [SerializeField] Button m_GoToBtn; |
| | | [SerializeField] Button m_ClaoseBtn; |
| | | PlayerMainDate m_MainModel;
|
| | | PlayerMainDate mainModel { get { return m_MainModel ?? (m_MainModel = ModelCenter.Instance.GetModel<PlayerMainDate>()); } }
|
| | | PlayerTaskDatas m_TaskModel;
|
| | | PlayerTaskDatas taskmodel { get { return m_TaskModel ?? (m_TaskModel = ModelCenter.Instance.GetModel<PlayerTaskDatas>()); } } |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | | |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | m_ClaoseBtn.AddListener(()=> { Close(); }); |
| | | m_GoToSkillBtn.AddListener(OnClickGoToSkillBtn); |
| | | m_OpenNowBtn.AddListener(OnClickOpenNowBtn); |
| | | m_GoToBtn.AddListener(OnClickGoToBtn); |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | | { |
| | | {
|
| | | string str = taskmodel.allMissionDict[mainModel.TaskSkillID].InforList;
|
| | | var taskinfo = Config.Instance.Get<TASKINFOConfig>(str);
|
| | | if (taskinfo != null)
|
| | | {
|
| | | m_Text_Condition_1.text= taskinfo.show_writing;
|
| | | }
|
| | | if (mainModel.TaskId_Skill.Contains(mainModel.TaskSkillID))
|
| | | {
|
| | | int Index = mainModel.TaskId_Skill.IndexOf(mainModel.TaskSkillID);
|
| | | m_Text_Reward_1.text = "开启第" + (mainModel.SkillIndex[Index]+1)+ "个被动技能槽";
|
| | | m_NeedMoney_Text.text = "花费" + mainModel.NeedFairyJade[Index] + "仙玉";
|
| | | }
|
| | | } |
| | | |
| | | protected override void OnAfterOpen() |
| | |
| | | |
| | | protected override void OnAfterClose() |
| | | { |
| | | |
| | | } |
| | | |
| | | private void OnClickGoToSkillBtn()
|
| | | {
|
| | | if (mainModel.TaskId_Skill.Contains(mainModel.TaskSkillID))
|
| | | {
|
| | | int Index = mainModel.TaskId_Skill.IndexOf(mainModel.TaskSkillID);
|
| | | mainModel.Skill_Index = mainModel.SkillIndex[Index];
|
| | | }
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.SkillFunc2);
|
| | | } |
| | | private void OnClickOpenNowBtn()
|
| | | {
|
| | | int Gold = (int)UIHelper.GetMoneyCnt(1);//仙玉
|
| | | if (mainModel.TaskId_Skill.Contains(mainModel.TaskSkillID))
|
| | | {
|
| | | int Index = mainModel.TaskId_Skill.IndexOf(mainModel.TaskSkillID);
|
| | | int NeedMoney = mainModel.NeedFairyJade[Index];
|
| | | string strNull = string.Format(Language.Get("PassiveSkillTask3"), NeedMoney);
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), strNull, (bool isOk) =>
|
| | | {
|
| | | if (isOk)
|
| | | {
|
| | | if (Gold >= NeedMoney)
|
| | | {
|
| | | taskmodel.CompletionOfTask(mainModel.TaskSkillID);
|
| | | WindowJumpMgr.Instance.WindowJumpTo(JumpUIType.SkillFunc2);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (VersionConfig.Get().isBanShu)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GoldErr");
|
| | | return;
|
| | | }
|
| | | WindowCenter.Instance.Open<RechargeTipWin>();
|
| | | }
|
| | | }
|
| | | });
|
| | | }
|
| | | } |
| | | private void OnClickGoToBtn()
|
| | | {
|
| | | |
| | | m_Text_Condition_1.ExcuteHref();
|
| | | |
| | | // Close();
|
| | | } |
| | | #endregion |
| | | |
| | |
|
| | | } |
| | | |
| | | } |