少年修仙传客户端代码仓库
client_linchunjie
2018-09-12 fad29a67b22ffc1a90f453dc03c91fe9ba891de0
System/MainInterfacePanel/FeatureNoticeWin.cs
@@ -26,9 +26,8 @@
        [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()
@@ -42,7 +41,6 @@
        protected override void OnPreOpen()
        {
            AddList();//添加数组列表
            DefaultSelection();//获取默认选择
            m_ScrollerController.OnRefreshCell += OnRefreshGridCell;       
            OnCreateGridLineCell(m_ScrollerController);
@@ -64,6 +62,10 @@
            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)
@@ -94,15 +96,15 @@
        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();
@@ -160,22 +162,6 @@
        {
        }
        #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>();
@@ -190,14 +176,14 @@
            }
            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;
            });
@@ -296,7 +282,15 @@
                {
                    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
                    {