void CreateHorizontalWithVertBot(PrimaryView a_top, PrimaryView a_botL, PrimaryView a_botR) { DeleteSecondaryPanels(); parentPanel.OnRightPanelResize.RemoveAllListeners(); PanelWithHorizontalSplitter l_panelHS = Instantiate(PanelWithHorizontalSplitterPrefab).GetComponent <PanelWithHorizontalSplitter>(); l_panelHS.transform.SetParent(parentPanel.rightPanel, false); parentPanel.OnRightPanelResize.AddListener(l_panelHS.OnParentPanelResize); l_panelHS.MoveSplitterToCenter(); a_top.transform.SetParent(l_panelHS.topPanel.transform, false); l_panelHS.OnTopPanelResize.AddListener(a_top.OnParentPanelResize); PanelWithVerticalSplitter l_panelVS = Instantiate(PanelWithVerticalSplitterPrefab).GetComponent <PanelWithVerticalSplitter>(); l_panelVS.transform.SetParent(l_panelHS.bottomPanel.transform, false); l_panelVS.MoveSplitterToCenter(); l_panelHS.OnBottomPanelResize.AddListener(l_panelVS.OnParentPanelResize); a_botL.transform.SetParent(l_panelVS.leftPanel.transform, false); a_botR.transform.SetParent(l_panelVS.rightPanel.transform, false); l_panelVS.OnLeftPanelResize.AddListener(a_botL.OnParentPanelResize); l_panelVS.OnRightPanelResize.AddListener(a_botR.OnParentPanelResize); parentPanel.AllignPanelsWithSplitter(); }
void CreateTwoHorizontal(PrimaryView a_btm, PrimaryView a_top) { DeleteSecondaryPanels(); parentPanel.OnTopPanelResize.RemoveAllListeners(); PanelWithHorizontalSplitter l_panelHS = Instantiate(PanelWithHorizontalSplitterPrefab).GetComponent <PanelWithHorizontalSplitter>(); l_panelHS.transform.SetParent(parentPanel.topPanel, false); parentPanel.OnTopPanelResize.AddListener(l_panelHS.OnParentPanelResize); l_panelHS.MoveSplitterToCenter(); a_btm.transform.SetParent(l_panelHS.bottomPanel.transform, false); a_top.transform.SetParent(l_panelHS.topPanel.transform, false); l_panelHS.OnBottomPanelResize.AddListener(a_btm.OnParentPanelResize); l_panelHS.OnTopPanelResize.AddListener(a_top.OnParentPanelResize); parentPanel.AllignPanelsWithSplitter(); }
private void ActivateThirdView() { if (secondView.isActiveAndEnabled && firstView.isActiveAndEnabled) { thirdView.transform.SetParent(threeViewLayout12.topPanel.transform, false); PanelWithVerticalSplitter bottomPanel = threeViewLayout12.bottomPanel.GetComponentInChildren <PanelWithVerticalSplitter>(); firstView.transform.SetParent(bottomPanel.leftPanel.transform, false); secondView.transform.SetParent(bottomPanel.rightPanel.transform, false); RemoveSubscribers(twoViewVerticalLayout, true); threeViewLayout12.OnTopPanelResize.AddListener(thirdView.OnParentPanelResize); threeViewLayout12.OnBottomPanelResize.AddListener(bottomPanel.OnParentPanelResize); bottomPanel.OnLeftPanelResize.AddListener(firstView.OnParentPanelResize); bottomPanel.OnRightPanelResize.AddListener(secondView.OnParentPanelResize); parentPanel.OnRightPanelResize.RemoveAllListeners(); parentPanel.OnRightPanelResize.AddListener(threeViewLayout12.OnParentPanelResize); DeactivateSlittedPanels(); thirdView.SetActiveAndSelect(true); threeViewLayout12.gameObject.SetActive(true); bottomPanel.splitter.transform.position = twoViewVerticalLayout.splitter.transform.position; threeViewLayout12.MoveSplitterToCenter(); bottomPanel.MoveSplitterToCenter(); threeViewLayout12.AllignPanelsWithSplitter(); } else if (secondView.isActiveAndEnabled) { thirdView.transform.SetParent(twoViewHorizontalLayout.topPanel.transform, false); secondView.transform.SetParent(twoViewHorizontalLayout.bottomPanel.transform, false); thirdView.SetActiveAndSelect(true); DeactivateSlittedPanels(); twoViewHorizontalLayout.gameObject.SetActive(true); RemoveSubscribers(twoViewVerticalLayout, true); twoViewHorizontalLayout.OnTopPanelResize.AddListener(thirdView.OnParentPanelResize); twoViewHorizontalLayout.OnBottomPanelResize.AddListener(secondView.OnParentPanelResize); parentPanel.OnRightPanelResize.RemoveAllListeners(); parentPanel.OnRightPanelResize.AddListener(twoViewHorizontalLayout.OnParentPanelResize); twoViewHorizontalLayout.MoveSplitterToCenter(); twoViewHorizontalLayout.AllignPanelsWithSplitter(); } else if (firstView.isActiveAndEnabled) { thirdView.transform.SetParent(twoViewHorizontalLayout.topPanel.transform, false); firstView.transform.SetParent(twoViewHorizontalLayout.bottomPanel.transform, false); thirdView.SetActiveAndSelect(true); DeactivateSlittedPanels(); twoViewHorizontalLayout.gameObject.SetActive(true); RemoveSubscribers(twoViewHorizontalLayout, true); twoViewHorizontalLayout.OnTopPanelResize.AddListener(thirdView.OnParentPanelResize); twoViewHorizontalLayout.OnBottomPanelResize.AddListener(firstView.OnParentPanelResize); parentPanel.OnRightPanelResize.RemoveAllListeners(); parentPanel.OnRightPanelResize.AddListener(twoViewHorizontalLayout.OnParentPanelResize); twoViewHorizontalLayout.MoveSplitterToCenter(); twoViewHorizontalLayout.AllignPanelsWithSplitter(); } }