Exemplo n.º 1
0
        public void Start()
        {
            button.onClick.AddListener(OnSelectTab);

            if (tabGroup == null)
            {
                if (GetComponentInParent <TabGroup>() != null)
                {
                    tabGroup = transform.parent.gameObject;
                }
                else
                {
                    Debug.Log("No Tab Group assigned on " + gameObject.name); return;
                }
            }
            if (tabGroup.GetComponent <MultiTabGroup>() != null)
            {
                _multiTabGroup = tabGroup.GetComponent <MultiTabGroup>();
                _multiTabGroup.Subscribe(this);
            }
            else
            {
                _tabGroup = tabGroup.GetComponent <TabGroup>();
                _tabGroup.Subscribe(this);
            }
        }