Exemplo n.º 1
0
        /// <summary>
        /// Invalidate a single row (before removing, or changing selection status)
        /// </summary>
        /// <param name="itemIndex"></param>
        protected void InvalidateItem(int itemIndex)
        {
            if (!_visibleItemList.Contains(itemIndex))
            {
                return;
            }

            _visibleItemList.Remove(itemIndex);

            for (var i = 0; i < _visibleRows.Count; i++)
            {
                if (_visibleRows[i].Index == itemIndex)
                {
                    RecycleRow(_visibleRows[i]);
                    _visibleRows.RemoveAt(i);
                    break;
                }
            }
        }
Exemplo n.º 2
0
        protected void Update()
        {
            if (!AlignBottom && !AlignTop)
            {
                Debug.LogWarning("[VirtualVerticalLayoutGroup] Only Lower or Upper alignment is supported.", this);
                childAlignment = TextAnchor.UpperLeft;
            }

            if (SelectedItem != null && !_itemList.Contains(SelectedItem))
            {
                SelectedItem = null;
            }
        }
Exemplo n.º 3
0
        private void MakeActive(SRTab tab)
        {
            if (!_tabs.Contains(tab))
            {
                throw new ArgumentException("tab is not a member of this tab controller", "tab");
            }

            if (_activeTab != null)
            {
                _activeTab.CachedGameObject.SetActive(false);

                if (_activeTab.TabButton != null)
                {
                    _activeTab.TabButton.IsActive = false;
                }

                if (_activeTab.HeaderExtraContent != null)
                {
                    _activeTab.HeaderExtraContent.gameObject.SetActive(false);
                }
            }

            _activeTab = tab;

            if (_activeTab != null)
            {
                _activeTab.CachedGameObject.SetActive(true);
                TabHeaderText.text = _activeTab.LongTitle;

                if (_activeTab.TabButton != null)
                {
                    _activeTab.TabButton.IsActive = true;
                }

                if (_activeTab.HeaderExtraContent != null)
                {
                    _activeTab.HeaderExtraContent.SetParent(TabHeaderContentContainer, false);
                    _activeTab.HeaderExtraContent.gameObject.SetActive(true);
                }
            }

            if (ActiveTabChanged != null)
            {
                ActiveTabChanged(this, _activeTab);
            }
        }