public void SetRemoteGuideStep(GuideTypePB guideType, int step) { //step = 1000; var currentStep = GuideManager.GetRemoteGuideStep(guideType); //引导步骤大于要设置的步骤的时候不做处理 Debug.LogError("currentStep" + currentStep + "step" + step); if (currentStep >= step) { return; } LoadingOverlay.Instance.Show(); var req = new GuideReq { GuideType = guideType, GuideId = step }; Debug.LogError("guideType:" + guideType + " step:" + step); var buffer = NetWorkManager.GetByteData(req); NetWorkManager.Instance.Send <GuideRes>(CMD.USERC_GUIDE, buffer, OnSetGuideSuccess); }
/// <summary> /// 设置新手引导统计点 /// </summary> /// <param name="step"></param> /// <param name="guideType"></param> public void SetStatisticsRemoteGuideStep(int step) { var type = GuideTypePB.MainGuideRecord; var lastStep = GuideManager.GetRemoteGuideStep(type); //获取上次的点 Debug.LogError("获取统计上次的点===>" + lastStep); if (step <= lastStep) { Debug.LogError("拦截掉重复发的点===>" + step); return; } ClientTimer.Instance.DelayCall(() => { Debug.LogError("发送统计的点p===>" + step); var req = new GuideReq { GuideType = type, GuideId = step }; var buffer = NetWorkManager.GetByteData(req); NetWorkManager.Instance.Send <GuideRes>(CMD.USERC_GUIDE, buffer, res => { Debug.LogError("更新统计点===>" + res.UserGuide.GuideId + "更新的统计类型===>" + res.UserGuide.GuideType); GuideManager.UpdateRemoteGuide(res.UserGuide); }); }, 0.3f); }
public void ExecuteStepComplete(TutorialStepData stepData) { if (stepData.id == TutorialProxy.instance.CurrentTutorialStepData.id) { if (TutorialProxy.instance.IsCompleteStep()) { int nextChapterID = TutorialProxy.instance.CurrentTutorialChapterData.nextID; GuideReq guideReq = new GuideReq(); guideReq.no = nextChapterID; guideReq.guideNo2 = 0; Logic.Protocol.ProtocolProxy.instance.SendProtocol(guideReq); } else if (!TutorialProxy.instance.IsAfterCompleteStep()) { GuideReq guideReq = new GuideReq(); guideReq.no = TutorialProxy.instance.CurrentTutorialChapterData.id; guideReq.guideNo2 = TutorialProxy.instance.CurrentTutorialChapterData.isBackup ? stepData.id + 100000 : stepData.id; Logic.Protocol.ProtocolProxy.instance.SendProtocol(guideReq); } if (TutorialProxy.instance.HasNextStep()) { TutorialProxy.instance.MoveToNextStep(stepData); TutorialView.Open(TutorialProxy.instance.CurrentTutorialChapterData, TutorialProxy.instance.CurrentTutorialStepData); Observers.Facade.Instance.SendNotification(TUTORIAL_STEP_COMPLETE_MSG); } else if (TutorialProxy.instance.HasNextChapter()) { TutorialProxy.instance.MoveToNextChapter(); CheckIfShouldOpenCurrentChapterOrCurrentBackupChapter(); } } }
public void SkipWholeTutorial() { TutorialProxy.instance.MoveToChapter(null); GuideReq guideReq = new GuideReq(); guideReq.no = int.MaxValue; guideReq.guideNo2 = int.MaxValue; Logic.Protocol.ProtocolProxy.instance.SendProtocol(guideReq); }
public void SkipCurrentTutorialChapter() { if (UIMgr.instance.IsOpening(TutorialView.PREFAB_PATH)) { TutorialView.Close(); } int skipChapterDataID = TutorialProxy.instance.CurrentTutorialChapterData.id; GuideReq guidReq = new GuideReq(); guidReq.no = skipChapterDataID + 1; Logic.Protocol.ProtocolProxy.instance.SendProtocol(guidReq); if (TutorialProxy.instance.HasNextChapter()) { TutorialProxy.instance.MoveToNextChapter(); } if (TutorialProxy.instance.onSkipCurrentChapterDelegate != null) { TutorialProxy.instance.onSkipCurrentChapterDelegate(skipChapterDataID); } }
void OnGUI() { GUILayout.Space(15); GUILayout.BeginHorizontal(); GUILayout.Label("内容:", GUILayout.Width(40)); bool isAddContent = false; content = EditorGUILayout.TextField(lable, content); content = content.Trim(); GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); isSave = GUILayout.Toggle(isSave, "保存"); if ((GUILayout.Button("发送") || (Event.current.keyCode == KeyCode.Return)) && Application.isPlaying) { if (string.IsNullOrEmpty(content)) { return; } Logic.Protocol.Model.GMReq gm = new Logic.Protocol.Model.GMReq(); if (content == "skip") { GuideReq guidReq = new GuideReq(); guidReq.no = 100; Logic.Protocol.ProtocolProxy.instance.SendProtocol(guidReq); //FightResultProxy.instance.GotoMainScene(Logic.Enums.FightResultQuitType.Go_MainView,FightResultProxy.instance.QuitPveCallback); Logic.Game.Controller.GameController.instance.ReLoadMainScene(); } else { gm.command = content; Logic.Protocol.ProtocolProxy.instance.SendProtocol(gm); } if (isSave) { if (!cacheStr.Contains(content)) { isAddContent = true; cacheStr.Add(content); } StringBuilder sb = new StringBuilder(); foreach (var str in cacheStr) { sb.AppendLine(str); } contents = sb.ToString(); } } GUILayout.EndHorizontal(); GUILayout.Label("历史记录:", GUILayout.Width(200)); string temp = EditorGUILayout.TextArea(contents, GUILayout.MinWidth(300), GUILayout.MinHeight(200)); if (temp != contents || isAddContent) { string[] strs = temp.Split(new string[] { "\r\n" }, System.StringSplitOptions.RemoveEmptyEntries); cacheStr.Clear(); cacheStr = new List <string>(strs); contents = temp; EditorPrefs.SetString("contents", contents); } }