/// <summary> /// If at any time this object's page count differs from the TextMeshPro's /// Set the current page = page count current page is greater /// And update the textMeshPro's current page accordingly. Update the PageIndicator as well. /// </summary> void Update() { if (pageCount != textMeshPro.textInfo.pageCount) { pageCount = textMeshPro.textInfo.pageCount; if (currentPage > pageCount) { currentPage = pageCount; textMeshPro.pageToDisplay = currentPage; if (pageIndicator != null) { pageIndicator.UpdatePage(currentPage); } } } if (pageCount > 1) { pageIndicator.gameObject.SetActive(true); pageIndicator.UpdatePage(currentPage); } else { pageIndicator.gameObject.SetActive(false); } }