public override void CreateButton(int index, GameObject page, int buttonIndex) { print(page.name); ButtonBase button = page.GetComponent <ButtonBase> (); int num = (StringKit.toInt(page.name) - 1); num = num < 0 ? 0 : num; int sid = FuBenManagerment.getAllShowStoryChapter(1)[num]; button.textLabel.text = ChapterSampleManager.Instance.getChapterSampleBySid(sid).name; }
public override void initAllButton(GameObject each) { // print (each.name); base.initAllButton(each); ButtonBase button = each.GetComponent <ButtonBase> (); int num = (StringKit.toInt(each.name) - 1); num = num < 0 ? 0 : num; int sid = FuBenManagerment.getAllShowStoryChapter(1)[num]; button.textLabel.text = ChapterSampleManager.Instance.getChapterSampleBySid(sid).name; }
//显示章节 private void showChapter() { List <ChapterSample> cs = new List <ChapterSample>(); int[] chapterIDs = FuBenManagerment.getAllShowStoryChapter(1); for (int i = 0; i < chapterIDs.Length; i++) { ChapterSample sample = ChapterSampleManager.Instance.getChapterSampleBySid(chapterIDs[i]); cs.Add(sample); } cs.Reverse(); if (content.gameObject.activeSelf) { content.init(cs); } MaskWindow.UnlockUI(); }