public void PrevPage() { page = Mathf.Max(page - 1, 0); if (page == 0) { LeftArrow.GetComponent <Image>().color = Color.clear; } else { RightArrow.GetComponent <Image>().color = new Color(255, 255, 255, 255); } LoadPage(); }
public void NextPage() { page = Mathf.Min(page + 1, max_pages - 1); if (page == max_pages - 1) { RightArrow.GetComponent <Image>().color = Color.clear; } else { LeftArrow.GetComponent <Image>().color = new Color(255, 255, 255, 255); } LoadPage(); }
void Update() { if ((!LeftArrow.GetComponent <GUIButton>().Pressed&& !RightArrow.GetComponent <GUIButton>().Pressed) || (LeftArrow.GetComponent <GUIButton>().Pressed&& RightArrow.GetComponent <GUIButton>().Pressed)) { TODO.Invoke(); } else if (LeftArrow.GetComponent <GUIButton>().Pressed) { LeftArrow.GetComponent <GUIButton>().TODOPressed.Invoke(); } else if (RightArrow.GetComponent <GUIButton>().Pressed) { RightArrow.GetComponent <GUIButton>().TODOPressed.Invoke(); } }