示例#1
0
    /// <summary>
    ///刷新
    /// </summary>
    /// <param name="pid"></param>
    private void RefreshGuideTargetObj(PanelID pid)
    {
        GuideDefine.LocalGuideGroupData localGroupData = null;
        GuideDefine.LocalGuideData      localGuideData = null;
        if (null != CurDoUnConstraintGuide && CurDoUnConstraintGuide.Count > 0)
        {
            var iemurator = CurDoUnConstraintGuide.GetEnumerator();
            while (iemurator.MoveNext())
            {
                localGroupData = iemurator.Current.Value;
                if (null == localGroupData || !localGroupData.LoopTrigger)
                {
                    continue;
                }
                if (localGroupData.CurStep != 0 &&
                    TryGetGuideLocalData(localGroupData.CurStep, out localGuideData) &&
                    localGuideData.GuideTargetDependPanel == pid)
                {
                    localGuideData.GuideTargetObj = null;
                }
            }
        }

        if (null != CurDoRepeatUnConstraintGuide)
        {
            if (CurDoRepeatUnConstraintGuide.CurStep != 0 &&
                TryGetGuideLocalData(CurDoRepeatUnConstraintGuide.CurStep, out localGuideData) &&
                localGuideData.GuideTargetDependPanel == pid)
            {
                localGuideData.GuideTargetObj = null;
            }
        }
    }
示例#2
0
    /// <summary>
    /// 是否当前正在执行引导组
    /// </summary>
    /// <param name="guideGroup"></param>
    /// <param name="guideId"></param>
    /// <returns></returns>
    public bool IsDoingGroup(uint guideGroup, out uint guideId)
    {
        guideId = 0;
        GuideDefine.LocalGuideGroupData groupData = null;
        if (TryGetGuideGroupData(guideGroup, out groupData))
        {
            if (groupData.GType == GuideDefine.GuideType.Unconstrain)
            {
                if (!groupData.LoopTrigger)
                {
                    if (null != CurDoUnConstraintGuide && CurDoUnConstraintGuide.Count != 0)
                    {
                        var iemurator = CurDoUnConstraintGuide.GetEnumerator();
                        GuideDefine.LocalGuideGroupData tempGroup = null;
                        while (iemurator.MoveNext())
                        {
                            tempGroup = iemurator.Current.Value;
                            if (tempGroup.GroupId == guideGroup)
                            {
                                guideId = tempGroup.CurStep;
                                return(true);
                            }
                        }
                    }
                }
                else if (null != CurDoRepeatUnConstraintGuide &&
                         CurDoRepeatUnConstraintGuide.GroupId == guideGroup)
                {
                    guideId = CurDoRepeatUnConstraintGuide.CurStep;
                    return(true);
                }
            }
            else if (groupData.GType == GuideDefine.GuideType.Constraint)
            {
                if (null != CurDoConstriantGuide &&
                    CurDoConstriantGuide.GroupId == guideGroup)
                {
                    guideId = CurDoConstriantGuide.CurStep;
                    return(true);
                }
            }
        }

        return(false);
    }
示例#3
0
    /// <summary>
    /// 重置引导
    /// </summary>
    private void ResetGuide()
    {
        //新手引导
        m_lst_completeGroupGuide.Clear();
        m_curDoConstraintGuide = null;
        m_lstTriggerGuideGroups.Clear();
        m_bGuideDataReady = false;
        if (null != m_dic_guideGroupDatas && m_dic_guideGroupDatas.Count != 0)
        {
            List <uint> groupIds = new List <uint>(m_dic_guideGroupDatas.Keys);
            for (int i = 0, max = groupIds.Count; i < max; i++)
            {
                m_dic_guideGroupDatas[groupIds[i]].Reset();
            }
        }

        if (null != m_dic_canDoGuideGroup)
        {
            m_dic_canDoGuideGroup.Clear();
        }

        if (null != CurDoUnConstraintGuide && CurDoUnConstraintGuide.Count > 0)
        {
            var iemurator = CurDoUnConstraintGuide.GetEnumerator();
            GuideDefine.LocalGuideGroupData localGroupData = null;
            while (iemurator.MoveNext())
            {
                localGroupData = iemurator.Current.Value;
                if (localGroupData.CurStep != 0)
                {
                    CancelUnconstrainGuideShow(localGroupData.CurStep);
                }
            }
            CurDoUnConstraintGuide.Clear();
        }

        if (null != m_curDoRepeatUnConstraintGuide)
        {
            if (m_curDoRepeatUnConstraintGuide.CurStep != 0)
            {
                CancelUnconstrainGuideShow(m_curDoRepeatUnConstraintGuide.CurStep);
            }
            m_curDoRepeatUnConstraintGuide = null;
        }
    }
示例#4
0
    /// <summary>
    /// 依赖面板关闭清空相应的循环触发引导(正在执行,或者等待执行的)
    /// </summary>
    /// <param name="id"></param>
    private void ClearRecycleTriggerGuideByPanel(PanelID pid)
    {
        //1、等待列表移除
        uint        tempID     = 0;
        List <uint> waitDoList = null;
        List <uint> removeList = null;
        List <uint> stepList   = null;

        GuideDefine.LocalGuideGroupData localGroupData = null;
        GuideDefine.LocalGuideData      localGuideData = null;
        if (m_dic_canDoGuideGroup.TryGetValue(GuideDefine.GuideType.Unconstrain, out waitDoList) &&
            waitDoList.Count > 0)
        {
            for (int i = 0, max = waitDoList.Count; i < max; i++)
            {
                tempID = waitDoList[i];
                if (!TryGetGuideGroupData(tempID, out localGroupData) || !localGroupData.LoopTrigger)
                {
                    continue;
                }
                stepList = localGroupData.GroupSteps;
                if (null == stepList || stepList.Count == 0)
                {
                    continue;
                }

                for (int j = 0, maxj = stepList.Count; j < maxj; j++)
                {
                    tempID = stepList[j];
                    if (!TryGetGuideLocalData(tempID, out localGuideData))
                    {
                        continue;
                    }

                    if (localGuideData.GuideTargetDependPanel == pid)
                    {
                        if (null == removeList)
                        {
                            removeList = new List <uint>();
                        }
                        if (!removeList.Contains(waitDoList[i]))
                        {
                            removeList.Add(waitDoList[i]);
                        }
                    }
                }
            }
        }
        if (null != removeList)
        {
            for (int i = 0, max = removeList.Count; i < max; i++)
            {
                tempID = removeList[i];
                waitDoList.Remove(tempID);
            }
        }

        //2、进行中引导
        if (null != CurDoUnConstraintGuide && CurDoUnConstraintGuide.Count > 0)
        {
            var iemurator = CurDoUnConstraintGuide.GetEnumerator();
            while (iemurator.MoveNext())
            {
                localGroupData = iemurator.Current.Value;
                if (null == localGroupData || !localGroupData.LoopTrigger)
                {
                    continue;
                }
                if (localGroupData.CurStep != 0 &&
                    TryGetGuideLocalData(localGroupData.CurStep, out localGuideData) &&
                    localGuideData.GuideTargetDependPanel == pid &&
                    (   //localGroupData.CurStep != localGroupData.FirstStep ||
                        pid != PanelID.MainPanel))
                {
                    if (null == removeList)
                    {
                        removeList = new List <uint>();
                    }
                    if (!removeList.Contains(localGroupData.GroupId))
                    {
                        removeList.Add(localGroupData.GroupId);
                    }
                }
            }
        }
        if (null != removeList)
        {
            for (int i = 0, max = removeList.Count; i < max; i++)
            {
                tempID = removeList[i];
                ResetGuideGroup(tempID);
            }
        }

        //3、重复触发引导
        if (null != CurDoRepeatUnConstraintGuide && CurDoRepeatUnConstraintGuide.CurStep != 0)
        {
            if (CurDoRepeatUnConstraintGuide.CurStep != 0 &&
                TryGetGuideLocalData(CurDoRepeatUnConstraintGuide.CurStep, out localGuideData) &&
                localGuideData.GuideTargetDependPanel == pid &&
                (       //localGroupData.CurStep != localGroupData.FirstStep ||
                    pid != PanelID.MainPanel))
            {
                ResetGuideGroup(CurDoRepeatUnConstraintGuide.GroupId);
            }
        }
    }