void OnSwipeLeft(TurnSwipeDetect swipeDetect) { StopVocalAudio(); m_wordWidget.mainTexture = m_nextChapterTexture; if (!IsLastPage()) { ++m_currentPage; StartCoroutine(TurnPage()); } }
void OnSwipeRight(TurnSwipeDetect swipeDetect) { StopVocalAudio(); m_wordWidget.mainTexture = m_chooseEmotionTexture; --m_currentPage; if (m_currentPage < 1) { m_currentPage = 1; } else { int index = m_currentPage + 1; StoryPage page = FindStoryPage(index); //Debug.LogWarning("name: " + page.gameObject.name); //Debug.LogWarning("hasImages: " + page.HasImages()); //Debug.LogWarning("isLastPage: " + page.IsLastPage()); if (page.IsLastPage()) { --index; page = FindStoryPage(index); //Debug.LogWarning("name: " + page.gameObject.name); //Debug.LogWarning("hasImages: " + page.HasImages()); //Debug.LogWarning("isLastPage: " + page.IsLastPage()); while (!page.HasImages()) { //Debug.LogWarning("CHECK"); --index; page = FindStoryPage(index); } //Debug.LogWarning("FOUND"); //Debug.LogWarning("name: " + page.gameObject.name); //Debug.LogWarning("hasImages: " + page.HasImages()); //Debug.LogWarning("isLastPage: " + page.IsLastPage()); StartCoroutine(ChangeImage(page)); } StartCoroutine(TurnPage()); } }