Ejemplo n.º 1
0
    private void CreateToggleGroup(string groupName, string[] dataNames, Transform parent)
    {
        for (int i = 0; i < dataNames.Length; i++)
        {
            //Init Models
            ToggleButtonModel nameToggle = new ToggleButtonModel();
            nameToggle.labeID          = i;
            nameToggle.label           = dataNames[i];
            nameToggle.toggleGroupName = groupName;

            //InitController

            ToggleButtonController cont = Controller.Instantiate <ToggleButtonController>(toggeButton, nameToggle, parent);

            //cont.transform.localScale = Vector3.one;
        }
    }
Ejemplo n.º 2
0
    //ToggleButtonController toggleDecoButton;
    //UILabel labGridHei;

    private void Start()
    {
        toggleModeButton = controlMenu.GetComponentsInChildren <ToggleButtonController>()[0];
        //toggleDecoButton = controlMenu.GetComponentsInChildren<ToggleButtonController>()[1];
        //modeList = controlMenu.GetComponentsInChildren<UIPopupList>()[1];
        tileNameLabel   = tileMenu.GetComponentsInChildren <UILabel>()[0];
        posLabel        = tileMenu.GetComponentsInChildren <UILabel>()[1];
        labpreviewBlock = PreviewMenu.GetComponentsInChildren <UILabel>()[0];
        tileMenu.SetActive(false);
        //heiList = tileMenu.GetComponentsInChildren<UIPopupList>()[0];

        //setting gridsize menu
        UIInput rowInput = gridSizeMenu.GetComponentsInChildren <UIInput>()[0];
        UIInput colInput = gridSizeMenu.GetComponentsInChildren <UIInput>()[1];

        //UIInput heiInput = gridSizeMenu.GetComponentsInChildren<UIInput>()[2];
        rowInput.validation = UIInput.Validation.Integer;
        colInput.validation = UIInput.Validation.Integer;
        //heiInput.validation = UIInput.Validation.Integer;

        labGridRow = rowInput.label;
        labGridCol = colInput.label;

        //labGridHei = heiInput.label;
        gridSizeMenu.SetActive(true);
        controlMenu.SetActive(false);

        //hiding menus
        HideTileMenu();
        HideClearGriMenu();

        //set highlight buttons
        for (int i = 0; i < ItemButtons.Length; i++)
        {
            UISprite highlight = ItemButtons[i].GetComponentsInChildren <UISprite>()[1];
            highlight.enabled = false;
        }
        helpMenu.SetActive(false);

        //DISABLE TILE FOR NOW
        //ItemButtons[2].GetComponent<UIButton>().state = UIButtonColor.State.Disabled;
        //ItemButtons[2].GetComponent<UIButton>().isEnabled = false;
        //ItemButtons[4].GetComponent<UIButton>().state = UIButtonColor.State.Disabled;
        //ItemButtons[4].GetComponent<UIButton>().isEnabled = false;
    }