少年修仙传客户端代码仓库
System/MainInterfacePanel/FeatureNotice2Win.cs
@@ -22,6 +22,7 @@
        [SerializeField] FeatureNoticeTip m_FeatureNoticeTip;
        [SerializeField] ScaleTween m_ScaleTween;
        FeatureNoticeModel featureNoticeModel { get { return ModelCenter.Instance.GetModel<FeatureNoticeModel>(); } }
        public int Offset = 0;//偏移
        private bool IsJump = false;
        #region Built-in
        protected override void BindController()
@@ -53,16 +54,28 @@
            {
                m_ScaleTween.SetEndState();
            }
        }
            featureNoticeModel.UpdateAwarfItem += UpdateAwarfItem;
        }
        private void UpdateAwarfItem()
        {
            m_ScrollerController.m_Scorller.RefreshActiveCellViews();//刷新可见
        }
        protected override void OnPreClose()
        {
        }
        protected override void OnAfterClose()
        {
            featureNoticeModel.UpdateAwarfItem -= UpdateAwarfItem;
        }
        protected override void OnActived()
        {
            var offset = 0f;
            m_ScrollerController.JumpIndex(JumpIndex(), ref offset);
            m_ScrollerController.JumpIndex(Offset + offset, 0, EnhancedScroller.TweenType.immediate);
        }
        private void OnClickBtn()
        {
            if (!WindowJumpMgr.Instance.IsJumpState)//是否经历跳
@@ -134,6 +147,28 @@
            }
        }
        private int JumpIndex()//Jump选中
        {
            int Index = 0;
            for (int i = 0; i < featureNoticeModel.FunctionList.Count; i++)
            {
                int funcID = featureNoticeModel.FunctionList[i].FuncId;
                if (featureNoticeModel.DicRedPoint.ContainsKey(funcID) && featureNoticeModel.DicRedPoint[funcID].state==RedPointState.Simple)
                {
                    Index = i;
                    return Index;
                }
            }
            Index = featureNoticeModel.FunctionList.FindIndex((x) =>
            {
                return x.FuncId == featureNoticeModel.FunctionForecastIndex;
            });
            if (Index == -1)
            {
                Index = 0;
            }
            return Index;
        }
        #endregion
    }