Exemplo n.º 1
0
    /// <summary>
    /// 创建章节
    /// </summary>
    /// <param name="chapterID"></param>
    /// <returns></returns>
    private static async System.Threading.Tasks.Task CreateChapter(int chapterID, bool isManor = false)
    {
        CSEntranceSection cSEntranceSection = new CSEntranceSection()
        {
            SectionId = chapterID
        };

        ProtocalManager.Instance().SendCSEntranceSection(cSEntranceSection, (SCEmptyEntranceSection sCEmptyEntranceSection) =>
        {
            Debug.Log("进入" + chapterID + "章记录成功");
        },
                                                         (ErrorInfo e) =>
        {
            Debug.LogError(e.ErrorMessage);
        });

        if (!isManor)
        {
            await CreateChapterTitle(chapterID);
        }
        //消除红点
        ReduceRedDot(chapterID, true);
        //播放章节背景音乐
        GameSoundPlayer.Instance.PlayBgMusic(MusicHelper.BgMusicChapter);

        ChapterTool.LoadChapterManager(chapterID - StaticData.configExcel.Section[0].SectionId);

        //进入章节后移除章节列表  重章节里回来后再出列表
        UIComponent.RemoveUI(UIType.UIChapter);
    }