/// <summary> /// 是否引导已完成 /// </summary> /// <param name="guideId"></param> /// <returns></returns> public bool IsGuideStepComplete(uint guideId) { GuideDefine.LocalGuideGroupData localGroupData = null; uint groupId = 0; if (TryGetGuideGroupID(guideId, out groupId) && TryGetGuideGroupData(groupId, out localGroupData)) { if (IsGuideGroupComplete(guideId)) { return(true); } if (localGroupData.GType == GuideDefine.GuideType.Unconstrain) { if (null != CurDoConstriantGuide && CurDoConstriantGuide.GroupId == guideId) { return(CurDoConstriantGuide.IsCompleteStep(guideId)); } } else if (localGroupData.GType == GuideDefine.GuideType.Constraint) { if (CurDoUnConstraintGuide.ContainsKey(localGroupData.GroupId)) { return(CurDoUnConstraintGuide[localGroupData.GroupId].IsCompleteStep(guideId)); } } } return(false); }
/// <summary> /// 重置引导组 /// </summary> /// <param name="groupID"></param> private void ResetGuideGroup(uint groupID) { uint curDoGuide = 0; if (IsDoingGroup(groupID, out curDoGuide)) { if (CurDoUnConstraintGuide.ContainsKey(groupID)) { CurDoUnConstraintGuide.Remove(groupID); } else if (null != CurDoRepeatUnConstraintGuide && CurDoRepeatUnConstraintGuide.GroupId == groupID) { m_curDoRepeatUnConstraintGuide = null; } CancelUnconstrainGuideShow(curDoGuide); } }
/// <summary> /// 完成引导 /// </summary> /// <param name="guideId"></param> private void CompleteGuide(uint guideId) { // Engine.Utility.Log.LogGroup("WJH", "CompleteGuide:" + guideId); GuideDefine.LocalGuideGroupData groupdata = null; uint groupID = 0; if (TryGetGuideGroupID(guideId, out groupID) && TryGetGuideGroupData(groupID, out groupdata)) { bool complete = false; if (groupdata.GType == GuideDefine.GuideType.Constraint) { if (null != CurDoConstriantGuide && CurDoConstriantGuide.CurStep == guideId) { CurDoConstriantGuide.LastestDoStep = guideId; CurDoConstriantGuide.EndCur(); if (CurDoConstriantGuide.CurStep == CurDoConstriantGuide.LastStepGuideID) { complete = true; CurDoConstriantGuide = null; } } } else if (groupdata.GType == GuideDefine.GuideType.Unconstrain) { if (CurDoUnConstraintGuide.ContainsKey(groupID)) { if (CurDoUnConstraintGuide[groupID].CurStep == guideId) { CurDoUnConstraintGuide[groupID].LastestDoStep = guideId; CurDoUnConstraintGuide[groupID].EndCur(); if (CurDoUnConstraintGuide[groupID].LastestDoStep == CurDoUnConstraintGuide[groupID].LastStepGuideID) { complete = true; CurDoUnConstraintGuide.Remove(groupID); } } } else if (null != CurDoRepeatUnConstraintGuide && CurDoRepeatUnConstraintGuide.CurStep == guideId) { CurDoRepeatUnConstraintGuide.LastestDoStep = guideId; CurDoRepeatUnConstraintGuide.EndCur(); if (CurDoRepeatUnConstraintGuide.LastestDoStep == CurDoRepeatUnConstraintGuide.LastStepGuideID) { complete = true; CurDoRepeatUnConstraintGuide = null; } } } //如果组最后一步发送消息到服务器保存已完成组 if (complete && !m_lst_completeGroupGuide.Contains(groupdata.GroupId)) { m_lst_completeGroupGuide.Add(groupdata.GroupId); //非循环引导 if (!groupdata.LoopTrigger) { SendGuideComplete(groupdata.GroupId); } } } }