Exemple #1
0
 public void Initialize(GUITabs tabParent, GUITabPage page)
 {
     mInitialized = true;
     Page         = page;
     TabParent    = tabParent;
     mSelected    = true;
     Selected     = false;
 }
Exemple #2
0
        public override void WakeUp()
        {
            base.WakeUp();

            TabPage = gameObject.GetComponent <GUITabPage>();
            TabPage.OnDeselected            += OnDeselected;
            SubSelectionTabs                 = gameObject.GetComponent <GUITabs>();
            SubSelectionTabs.OnSetSelection += OnSetSelection;
        }
Exemple #3
0
        public override void WakeUp()
        {
            base.WakeUp();

            SubSelectionTabs = gameObject.GetComponent <GUITabs>();
            SubSelectionTabs.OnSetSelection += OnSetSelection;
            mPlantDoppleganger.PackName      = "Plants";
            mPlantDoppleganger.PrefabName    = "WorldPlant";
            mPlantDoppleganger.State         = "Raw";
            TabPage = gameObject.GetComponent <GUITabPage>();
            TabPage.OnDeselected += OnDeselected;
        }
Exemple #4
0
        public override void WakeUp()
        {
            base.WakeUp();

            TabPage          = gameObject.GetComponent <GUITabPage>();
            SubSelectionTabs = gameObject.GetComponent <GUITabs>();
            if (SubSelectionTabs != null)
            {
                SubSelectionTabs.OnSetSelection += OnSetSelection;
            }
            else
            {
                //Debug.Log ("SUBSELECTION TABS WAS NULL IN " + name);
            }
        }
 public override void Awake()
 {
     CraftingTabPage = gameObject.GetComponent <GUITabPage>();
 }
Exemple #6
0
        public void Initialize(IGUITabOwner owner)
        {
            if (owner == this)
            {
                Debug.Log("TABS CANNOT OWN THEMSELVES IN " + name);
                return;
            }

            Owner         = owner;
            Owner.OnShow += Show;
            Owner.OnHide += Hide;
            NGUICamera    = owner.NGUICamera;
            Buttons.Clear();
            Pages.Clear();

            foreach (Transform child in transform)
            {
                GUITabButton tabButton = null;
                if (child.gameObject.HasComponent <GUITabButton>(out tabButton))
                {
                    tabButton.name = name + "-" + tabButton.Name;
                    Buttons.Add(tabButton);
                }

                GUITabPage page = null;
                if (child.gameObject.HasComponent <GUITabPage>(out page))
                {
                    page.NGUICamera = NGUICamera;
                    Pages.Add(page);
                    GUITabs subTabs = null;
                    if (child.gameObject.HasComponent <GUITabs>(out subTabs))
                    {
                        page.SubTabs       = subTabs;
                        subTabs.NGUICamera = NGUICamera;
                        subTabs.ParentTabs = this;
                        subTabs.Initialize(this);
                        SubTabs.Add(subTabs);
                    }
                }
            }

            //sort the buttons
            Buttons.Sort();

            for (int i = 0; i < Pages.Count; i++)
            {
                for (int j = 0; j < Buttons.Count; j++)
                {
                    if (Pages[i].name == Buttons[j].Name)
                    {
                        Pages[i].NGUICamera = NGUICamera;
                        Pages[i].Initialize(this, Buttons[j]);
                        Buttons[j].Initialize(this, Pages[i]);
                    }
                }
            }

            for (int i = 0; i < Buttons.Count; i++)
            {
                if (!Buttons[i].Initialized)
                {
                    Buttons[i].Initialize(this, null);
                }
            }

            mInitialized = true;

            if (Visible)
            {
                Show();
            }
            else
            {
                Hide();
            }
        }