コード例 #1
0
        private bool AddChannelInternal(FizzChannelModel _item)
        {
            if (_item == null)
            {
                return(false);
            }

            bool _added = false;

            if (!_channelsLookup.ContainsKey(_item.Id))
            {
                FizzChannelView _button = Instantiate(ChannelPrefab);
                _button.gameObject.SetActive(true);
                _button.transform.SetParent(GetChannelGroup(_item).transform, false);
                _button.transform.SetAsLastSibling();
                _button.transform.localScale = Vector3.one;
                _button.SetData(_item, HandleChannelSelected);
                _channelsLookup.Add(_item.Id, _button);
                _button.gameObject.name = _item.Name;

                if (!string.IsNullOrEmpty(_item.Meta.Group) && _groupsLookup.ContainsKey(_item.Meta.Group))
                {
                    _groupsLookup[_item.Meta.Group].ChannelCount++;
                }

                _added = true;
            }
            return(_added);
        }