/*-----------------------------------------------------------------*/

        #region MonoBehavior

        protected override void Awake()
        {
            base.Awake();

            var button = Control;

            if (button != null)
            {
                button.OnClickAsObservable()
                .Subscribe(_ => (Element as IButtonController)?.SendClicked())
                .AddTo(button);
            }

            _componentText = new TextTracker(button.GetComponentInChildren <UnityEngine.UI.Text>());
        }
Пример #2
0
        /*-----------------------------------------------------------------*/

        #region MonoBehavior

        protected override void Awake()
        {
            base.Awake();

            var inputField = Control;

            if (inputField != null)
            {
                inputField.lineType = UnityEngine.UI.InputField.LineType.SingleLine;
                inputField.OnValueChangedAsObservable()
                .BlockReenter()
                .Subscribe(value =>
                {
                    var element = Element;
                    if (element != null)
                    {
                        element.Text = value;
                    }
                }).AddTo(inputField);

                _componentText = new TextTracker(inputField.textComponent);
            }
        }
Пример #3
0
        /*-----------------------------------------------------------------*/
        #region MonoBehavior

        protected override void Awake()
        {
            base.Awake();

            _componentText = new TextTracker(Control);
        }