Example #1
0
        private void Start()
        {
            for (var i = 0; i < _texts.Count; i++)
            {
                _texts[i].transform.parent.gameObject.SetActive(i < _intCollection.Count);

                var j = i;
                if (i < _intCollection.Count)
                {
                    _intCollection.SubscribeToValueAt(i, value => _texts[j].text = "" + value);
                }
            }

            _intCollection.SubscribeOnAdd(OnCollectionAdded);
            _intCollection.SubscribeOnRemove(OnCollectionRemoved);
        }