Exemplo n.º 1
0
        void Start()
        {
            sendStr = new ReactiveProperty <string> ();

            sendStr.Subscribe(_ => _history.PushText(_));

            _sendButton.onClick.AddListener(() => {
                sendStr.Value = _sendText.text;
            });
        }
Exemplo n.º 2
0
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            TextHistory history = target as TextHistory;

            GUILayout.BeginHorizontal();
            sampleText = GUILayout.TextField(sampleText);
            if (GUILayout.Button("Push"))
            {
                if (!string.IsNullOrEmpty(sampleText))
                {
                    history.PushText(sampleText);
                }
            }
            GUILayout.EndHorizontal();
            if (GUILayout.Button("Clean"))
            {
                history.Clear();
            }
        }
Exemplo n.º 3
0
 public void Init(IObservable <string> obs)
 {
     _property = new ReactiveProperty <string> (obs);
     _property.Subscribe(_ => _history.PushText(_));
 }
Exemplo n.º 4
0
 public void Init(string str)
 {
     _property = new StringReactiveProperty(str);
     _property.Subscribe(_ => _history.PushText(_));
 }