Пример #1
0
 protected virtual void OnTabCreated(int index, ITabMediator tab)
 {
     foreach (var component in _components)
     {
         component.OnTabCreated(index, tab);
     }
 }
Пример #2
0
        protected void CreateTabContent(int tabIndex)
        {
            //create view and mediator if it does not exist
            if (CreatedContent[tabIndex] == null)
            {
                ITabMediator tab = GetMediatorForContent(GetTabContentPrefab(tabIndex), tabIndex);

                if (tab != null)
                {
                    tab.TabIndex             = tabIndex;
                    CreatedContent[tabIndex] = tab;
                    OnTabCreated(tabIndex, tab);
                }
                else
                {
                    Debug.LogErrorFormat(
                        "<color=\"aqua\">{0} : Tab content is null. GetMediatorForContent is probably not returning mediator</color>",
                        this);
                }
            }
            else
            {
                //Just for scrollToTabcomponent which is removing tabs from parent
                CreatedContent[tabIndex].SetParent(View.ContentsParent, true);
                CreatedContent[tabIndex].SetSiblingIndex(tabIndex);
            }
        }
Пример #3
0
        protected virtual void SetTabActive(int tabIndex, bool value)
        {
            ITabMediator tabContent = CreatedContent[tabIndex];

            if (tabContent != null)
            {
                tabContent.SetActive(value);
            }
        }