//获得指定剧情章节sid 索引从1开始 public static int getStoryChapterByIndex(int mapId, int index) { FuBenStoryMap map = FuBenStoryConfigManager.Instance.getFuBenStoryMap(mapId); if (map == null) { return(-1); } return(map.chapterSids [index - 1]); }
//解析配置 public override void parseConfig(string str) { if (maps == null) { maps = new List <FuBenStoryMap> (); } FuBenStoryMap map = new FuBenStoryMap(str); maps.Add(map); }
public static int getStoryChapterIndexBySid(int mapId, int sid) { FuBenStoryMap map = FuBenStoryConfigManager.Instance.getFuBenStoryMap(mapId); if (map == null) { return(-1); } for (int i = 0; i < map.chapterSids.Length; i++) { if (map.chapterSids [i] == sid) { return(i); } } return(-1); }
//获得指定剧情地图对应索引的章节sid 索引从1开始 public static int[] getAllShowStoryChapter(int mapId) { FuBenStoryMap map = FuBenStoryConfigManager.Instance.getFuBenStoryMap(mapId); if (map == null) { return(null); } //默认总显示第一张 List <int> list = new List <int> (); list.Add(map.chapterSids [0]); int tmplastID = map.chapterSids [0]; for (int i = 0; i < map.chapterSids.Length; i++) { if (FuBenManagerment.Instance.isStoryChapterShow(map.chapterSids [i]) == true) { list.Add(map.chapterSids [i]); tmplastID = map.chapterSids [i]; } } //更新最后章 if (tmplastID > FuBenManagerment.Instance.oldLastStoryChapterID) { FuBenManagerment.Instance.oldLastStoryChapterID = tmplastID; } return(list.ToArray()); }