Exemplo n.º 1
0
        public void Reset()
        {
            if (!_initialized)
            {
                Initialize();
            }

            CurrentSelectedChannel = null;

            foreach (KeyValuePair <string, FizzChannelView> pair in _channelsLookup)
            {
                FizzChannelView button = pair.Value;
                if (button != null)
                {
                    Destroy(button.gameObject);
                }
            }

            foreach (KeyValuePair <string, FizzChannelGroupView> pair in _groupsLookup)
            {
                FizzChannelGroupView group = pair.Value;
                if (group != null)
                {
                    Destroy(group.gameObject);
                }
            }

            _channelsLookup.Clear();
            _groupsLookup.Clear();
            _channelWatchList.Clear();
        }
Exemplo n.º 2
0
        private RectTransform AddChannelGroup(FizzChannelModel channel, string channelGroup)
        {
            RectTransform groupRect = null;

            if (!_groupsLookup.ContainsKey(channelGroup))
            {
                FizzChannelGroupView channelGroupView = Instantiate(ChannelGroupPrefab);
                channelGroupView.gameObject.SetActive(true);
                channelGroupView.transform.SetParent(Container.transform, false);
                channelGroupView.transform.localScale = Vector3.one;
                channelGroupView.SetData(channel.Meta.Group);
                _groupsLookup.Add(channelGroup, channelGroupView);
                groupRect = channelGroupView.RectTransform;
                channelGroupView.gameObject.name = channelGroup;
            }
            return(groupRect);
        }