Exemplo n.º 1
0
 void setupPageButton(ToggleableColorUIButton pageButton, int pageIndex)
 {
     pageButton.SubscribeToClick(delegate()
     {
         parentWindow.SwitchToPage(pageIndex, onClickPageButton: true);
     });
     pageButton.SetToggleOnClickEnabled(isEnabled: false);
 }
Exemplo n.º 2
0
 public void SwitchToPage(int pageIndex, bool onClickPageButton)
 {
     checkReferences();
     if (HasSelectedPage)
     {
         // Turn off the last page button
         selectedPageButton.Toggle();
     }
     selectedPageButton = pageButtons[pageIndex];
     if (!onClickPageButton)
     {
         selectedPageButton.Toggle();
     }
 }
Exemplo n.º 3
0
    // There are extra steps that do not need to be performed on init
    ToggleableColorUIButton addPageButton(int pageIndex, bool addingOnInit)
    {
        GameObject buttonobject = Instantiate(pageButtonRef, pageButtonParent);

        buttonobject.SetActive(true);
        ToggleableColorUIButton pageButton = buttonobject.GetComponent <ToggleableColorUIButton>();

        if (!addingOnInit)
        {
            setupPageButton(pageButton, pageIndex);
            refreshPageButtonReferences();
        }
        return(pageButton);
    }