public void OnSelect(BaseEventData eventData)
    {
        Button refButton = gameObject.GetComponent <Button>();

        gameObject.GetComponent <Image>().material = privateMatOn;

        if (!refButton.interactable)
        {
            refButton.targetGraphic.color = refButton.colors.highlightedColor;
        }

        Navigation nav = refButton.navigation;
        int        indexOn;

        if (LoadShipManagement.GetSingleton().HasPanelOn(out indexOn))
        {
            nav.selectOnLeft = parentContent.transform.GetChild(indexOn).GetComponent <Toggle>();
        }
        else
        {
            if (parentContent.transform.childCount > 0)
            {
                float t     = parentContent.GetComponent <VerticalLayoutGroup>().padding.top;
                float index = (-t + StartUpValue) / (2 * height);

                nav.selectOnLeft = parentContent.transform.GetChild((int)index).GetComponent <Toggle>();
            }
            else
            {
                nav.selectOnLeft = null;
            }
        }
        refButton.navigation = nav;
    }
Beispiel #2
0
 public void OnCancel(BaseEventData eventData)
 {
     LoadShipManagement.GetSingleton().CancelLoadPanel();
 }
Beispiel #3
0
 public void OnSubmit(BaseEventData eventData)
 {
     this.GetComponent <Toggle>().isOn = true;
     EventSystem.current.SetSelectedGameObject(null);
     EventSystem.current.SetSelectedGameObject(LoadShipManagement.GetSingleton().CancelButtonLoadPanel.gameObject);
 }