Exemplo n.º 1
0
    protected override void OnAwake()
    {
        base.OnAwake();

        _textPanelsInstances.Add(new Pair()
        {
            Button = _textFieldButtonDefault,
            Page   = _page
        });

        _textFieldButtonDefault.SetTexts(new List <string>());
        SetCurrentSelectButton(_textFieldButtonDefault);
        _textFieldButtonDefault.GetButton().onClick.AddListener(() => ButtonClickedListener(_textFieldButtonDefault));
        ButtonClickedListener(_textFieldButtonDefault);
        _createNewTextButton.onClick.AddListener(CreateNewTextButtonListener);
        _textFieldButtonDefault.DestroyObjectEvent.AddEventListener(DefaultButtonResetClickedListener);
    }
Exemplo n.º 2
0
    public GUI_TextFieldButton CreateTextInstance(string name, List <string> text)
    {
        GUI_TextFieldCloseButton instance = Instantiate(_textfieldButtonPrefab, _buttonAnchor);
        var page = new Pair()
        {
            Button = instance,
            Page   = _page
        };

        instance.SetButtonName(name);
        _textPanelsInstances.Add(page);
        instance.SetTexts(text);
        SetCurrentSelectButton(instance);
        instance.GetButton().onClick.AddListener(() => ButtonClickedListener(instance));
        instance.DestroyObjectEvent.AddEventListener(RemoveTextInstance);
        ButtonClickedListener(instance);

        return(instance);
    }