public static UIManagerTool GetInstance() { if (_uiManager == null) { _uiManager = new UIManagerTool(); } return(_uiManager); }
// Use this for initialization void Start() { uiManagerTool = TJ_UNITY_TOOL.UIManagerTool.GetInstance(); uiManagerTool.setPanel(UIPanel, NoticePanel, NetPanel); uiManagerTool.addUIToPanel("UI/Panel_1", TJ_UNITY_TOOL.UIManagerTool.UI_PANEL_TYPE.UI, "Panel_1", false, false); uiManagerTool.addUIToPanel("UI/Panel_2", TJ_UNITY_TOOL.UIManagerTool.UI_PANEL_TYPE.UI, "Panel_2", false, false); uiManagerTool.addUIToPanel("UI/Panel_3", TJ_UNITY_TOOL.UIManagerTool.UI_PANEL_TYPE.UI, "Panel_3", false, false); uiManagerTool.addUIToPanel("UI/Panel_2", TJ_UNITY_TOOL.UIManagerTool.UI_PANEL_TYPE.UI, "Panel_2", false, false); //按钮 Button buttonComp_1 = button_1.GetComponent <Button>(); Button buttonComp_2 = button_2.GetComponent <Button>(); buttonComp_1.onClick.AddListener(() => { uiManagerTool.hideUI(TJ_UNITY_TOOL.UIManagerTool.UI_PANEL_TYPE.UI, "Panel_1"); }); buttonComp_2.onClick.AddListener(() => { uiManagerTool.showUI(TJ_UNITY_TOOL.UIManagerTool.UI_PANEL_TYPE.UI, "Panel_1"); }); }