Exemplo n.º 1
0
        private void AddNewInfoInCurrentList(SoftGuideInfo info)
        {
            SoftGuideInfo curInfo;
            bool          contain = false;

            for (int i = 0, count = _currentGuideList.Count; i < count; i++)
            {
                curInfo = _currentGuideList[i];
                if (curInfo.id == info.id)
                {
                    contain = true;
                    break;
                }
            }

            if (!contain)
            {
                if (info.data.id == (int)Logic.Enums.FunctionOpenType.MainView_Activity)
                {
                    LuaInterface.ToLuaPb.SetFromLua((int)Logic.Protocol.Model.MSG.ActivityListReq);
                }
                if (info.data.id == (int)FunctionOpenType.MainView_Chat)
                {
                    LuaInterface.ToLuaPb.SetFromLua((int)Logic.Protocol.Model.MSG.ChatInfoReq);
                }
                _currentGuideList.Add(info);
            }
        }
Exemplo n.º 2
0
        public void OnClickSoftGuideView(SoftGuideView view)
        {
            // Debug.Log(view.id + "," + view.status);
            SoftGuideInfo info = null;

            for (int i = 0, count = _currentGuideList.Count; i < count; i++)
            {
                if (_currentGuideList[i].id == view.id)
                {
                    info = _currentGuideList[i];
                    break;
                }
            }
            if (info != null)
            {
                if (view.status == SoftGuideView.StatusType.FirstView)                //一级界面
                {
                    if (!info.hasSecondView)
                    {
                        info.isTipOver = true;
                        bool hasSame = CheckFirstSame(info);
                        if (!hasSame)
                        {
                            RemoveSoftEffectTip(view.transform);
                        }
                    }
                }
                else if (view.status == SoftGuideView.StatusType.SecondView)                //二级界面
                {
                    info.isTipOver = true;
                    bool hasSame = CheckSecondSame(info);
                    if (!hasSame)
                    {
                        RemoveSoftEffectTip(view.transform);
                    }
                    hasSame = CheckFirstSame(info);
                    if (!hasSame)
                    {
                        GameObject firstView = UIMgr.instance.Get(info.firstViewPath);
                        if (firstView != null)
                        {
                            RemoveSoftEffectTip(firstView.transform.Find(info.firstButtonPath));
                        }
                    }
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 检查二级界面相同
        /// </summary>
        private bool CheckSecondSame(SoftGuideInfo info)
        {
            int           count = _currentGuideList.Count;
            SoftGuideInfo curInfo;

            for (int i = 0; i < count; i++)
            {
                curInfo = _currentGuideList[i];
                if (!curInfo.isTipOver)
                {
                    if (curInfo.hasSecondView && info.SecondViewPath.Equals(curInfo.SecondViewPath) && info.SecondButtonPath.Equals(curInfo.SecondButtonPath))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Exemplo n.º 4
0
        public void Init()
        {
            if (_isInit)
            {
                return;
            }
            _isInit = true;
            _funcResisterDic.Clear();
            _guideInfoDictionary.Clear();
            _currentGuideList.Clear();
            _functionOpenDic.Clear();
            Dictionary <int, FunctionData> dataDic = FunctionData.FunctionDataDictionary;
            SoftGuideInfo info;

            foreach (var value in dataDic)
            {
                if (!FunctionOpenProxy.instance.IsFunctionOpen((FunctionOpenType)value.Key))
                {
                    info = new SoftGuideInfo(value.Key, false);

                    if (info.hasFirstView)
                    {
                        RegisterObserver(info.firstViewPath);
                        _guideInfoDictionary.Add(value.Key, info);
                    }
                    if (info.hasSecondView)
                    {
                        RegisterObserver(info.SecondViewPath);
                    }
                    if (!string.IsNullOrEmpty(info.data.show_new_des))
                    {
                        _functionOpenDic.Add(value.Key, false);
                    }
                }
            }
            Observers.Facade.Instance.RegisterObserver("UpdateSoftGuideByLua", UpdateSoftGuideByLua);
        }