private void RefreshPreviousAndNextChapterButtons() { int currentSelectChapterLastDungeonID = _currentSelectChapterData.GetChapterDungeonIDListOfDungeonType(_currentSelectDungeonType).Last(); DungeonInfo currentSelectChapterLastDungeonInfo = DungeonProxy.instance.GetDungeonInfo(currentSelectChapterLastDungeonID); bool shouldShowPreviousChapterButton = _currentSelectChapterData.Id > 1; bool shouldShowNextChapterButton = _currentSelectChapterData.NextChapterData != null && currentSelectChapterLastDungeonInfo.star > 0; previousChapterButton.gameObject.SetActive(shouldShowPreviousChapterButton); nextChapterButton.gameObject.SetActive(shouldShowNextChapterButton); }
public int GetTotalStarCountOfChapterOfDungeonType(DungeonType dungeonType, int chapterID) { ChapterData chapterData = ChapterData.GetChapterDataById(chapterID); List <int> dungeonIDList = chapterData.GetChapterDungeonIDListOfDungeonType(dungeonType); return(dungeonIDList.Count * 3); }
public int GetPlayerGainStarCountOfChapterOfDungeonType(DungeonType dungeonType, int chapterID) { int playerGainStarCountOfChpaterOfDungeonType = 0; ChapterData chapterData = ChapterData.GetChapterDataById(chapterID); List <int> dungeonIDList = chapterData.GetChapterDungeonIDListOfDungeonType(dungeonType); DungeonInfo dungeonInfo = null; for (int i = 0; i < dungeonIDList.Count; i++) { playerGainStarCountOfChpaterOfDungeonType += GetDungeonInfo(dungeonIDList[i]).star; } return(playerGainStarCountOfChpaterOfDungeonType); }