| | |
| | | [SerializeField] Text m_TextUnopened;//未开启 |
| | | [SerializeField] Text m_Textschedule;//进度 |
| | | [SerializeField] Button m_ButtonGoto; |
| | | List<FunctionForecastConfig> FunctionList = new List<FunctionForecastConfig>(); |
| | | |
| | | TreasureModel treasureModel { get { return ModelCenter.Instance.GetModel<TreasureModel>(); } } |
| | | FeatureNoticeModel featureNoticeModel { get { return ModelCenter.Instance.GetModel<FeatureNoticeModel>(); } } |
| | | #region Built-in |
| | | private int ClickFuncID = 0; |
| | | protected override void BindController() |
| | |
| | | |
| | | protected override void OnPreOpen() |
| | | {
|
| | | AddList();//添加数组列表
|
| | | DefaultSelection();//获取默认选择
|
| | | m_ScrollerController.OnRefreshCell += OnRefreshGridCell; |
| | | OnCreateGridLineCell(m_ScrollerController); |
| | |
| | | m_ScrollerController.OnRefreshCell -= OnRefreshGridCell;
|
| | | treasureModel.treasureStateChangeEvent -= treasureStateChangeEvent;
|
| | | treasureModel.treasureStageUpEvent -= treasureStageUpEvent; |
| | | if (featureNoticeModel.redPointStre1.state == RedPointState.Simple)
|
| | | {
|
| | | featureNoticeModel.redPointStre1.state = RedPointState.None;
|
| | | } |
| | | }
|
| | |
|
| | | private void treasureStageUpEvent(int obj)
|
| | |
| | | void OnCreateGridLineCell(ScrollerController gridCtrl)
|
| | | {
|
| | | gridCtrl.Refresh();
|
| | | for (int i = 0; i < FunctionList.Count; i++)
|
| | | for (int i = 0; i < featureNoticeModel.FunctionList.Count; i++)
|
| | | {
|
| | | if (i == 0)
|
| | | {
|
| | | gridCtrl.AddCell(ScrollerDataType.Header, FunctionList[i].FuncId);
|
| | | gridCtrl.AddCell(ScrollerDataType.Header, featureNoticeModel.FunctionList[i].FuncId);
|
| | | }
|
| | | else
|
| | | {
|
| | | gridCtrl.AddCell(ScrollerDataType.Normal, FunctionList[i].FuncId);
|
| | | gridCtrl.AddCell(ScrollerDataType.Normal, featureNoticeModel.FunctionList[i].FuncId);
|
| | | }
|
| | | }
|
| | | gridCtrl.Restart();
|
| | |
| | | { |
| | | }
|
| | | #endregion |
| | | private void AddList()//添加列表信息
|
| | | {
|
| | | if (FunctionList.Count <= 0)
|
| | | {
|
| | | var configs = Config.Instance.GetAllKeys<FunctionForecastConfig>();
|
| | | foreach (var key in configs)
|
| | | {
|
| | | var functionForecastConfig = Config.Instance.Get<FunctionForecastConfig>(key);
|
| | | if (functionForecastConfig != null && functionForecastConfig.Display == 1)
|
| | | {
|
| | | FunctionList.Add(functionForecastConfig);
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | | |
| | | private void DefaultSelection()//获取默认选择
|
| | | {
|
| | | var configs = Config.Instance.GetAllValues<FunctionForecastConfig>();
|
| | |
| | | }
|
| | | if (ClickFuncID == 0)
|
| | | {
|
| | | ClickFuncID = FunctionList[0].FuncId;
|
| | | ClickFuncID = featureNoticeModel.FunctionList[0].FuncId;
|
| | | }
|
| | | } |
| | | |
| | | private int JumpIndex()//Jump选中
|
| | | {
|
| | | int Index = 0;
|
| | | Index = FunctionList.FindIndex((x)=> |
| | | Index = featureNoticeModel.FunctionList.FindIndex((x)=> |
| | | {
|
| | | return x.FuncId == ClickFuncID;
|
| | | });
|
| | |
| | | {
|
| | | if (treasure.stage == funcStage - 1 || funcStage == 0)
|
| | | {
|
| | | m_Textschedule.text = (float)treasure.exp / treasure.treasureStages[funcStage].exp+"%";
|
| | | if (treasure.exp >= treasure.treasureStages[funcStage].exp)
|
| | | {
|
| | | m_Textschedule.text = "100%";
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Textschedule.text = (float)treasure.exp / treasure.treasureStages[funcStage].exp + "%";
|
| | | }
|
| | | |
| | | }
|
| | | else
|
| | | {
|