private void Initialize() { if (!initialized) { initialized = true; Instance = this; ManageTournamentMenuResponder responder = new ManageTournamentMenuResponder(this); flexMenu = GetComponent <FlexMenu>(); mainPanel = GetComponentInChildren <FlexPanelComponent>(); var btns = GetComponentsInChildren <FlexButtonComponent>(true); foreach (var button in btns) { mainPanel.AddAction(button); buttons.Add(button.gameObject.name, button); } var txts = GetComponentsInChildren <TMPro.TextMeshPro>(true); foreach (var txt in txts) { if (!text.ContainsKey(txt.gameObject.name)) { text.Add(txt.gameObject.name, txt); } } flexMenu.RegisterResponder(responder); } }
public void AddPanel(FlexPanelComponent panel) { panels.Add(panel.gameObject.name, panel); #if UNITY_EDITOR panelList.Add(panel.gameObject); #endif panel.SetMenu(this); }
// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = public void SetupComponent(FlexPanelComponent panel, Action <FlexActionableComponent, GameObject> startAction, Action <FlexActionableComponent, GameObject> endAction) { this.panel = panel; SetEnterCallback(startAction); SetExitCallback(endAction); AssembleComponent(); }