void CreateSingleView(PrimaryView a_view) { DeleteSecondaryPanels(); a_view.transform.SetParent(parentPanel.rightPanel, false); parentPanel.OnRightPanelResize.RemoveAllListeners(); parentPanel.OnRightPanelResize.AddListener(a_view.OnParentPanelResize); parentPanel.AllignPanelsWithSplitter(); }
private void DeactivateThirdView() { if (firstView.isActiveAndEnabled && secondView.isActiveAndEnabled) { firstView.transform.SetParent(twoViewVerticalLayout.leftPanel.transform, false); secondView.transform.SetParent(twoViewVerticalLayout.rightPanel.transform, false); secondView.SetActiveAndSelect(true); DeactivateSlittedPanels(); twoViewVerticalLayout.gameObject.SetActive(true); RemoveSubscribers(twoViewVerticalLayout, true); RemoveSubscribers(threeViewLayout12, true); RemoveSubscribers(threeViewLayout23, true); twoViewVerticalLayout.OnLeftPanelResize.AddListener(firstView.OnParentPanelResize); twoViewVerticalLayout.OnRightPanelResize.AddListener(secondView.OnParentPanelResize); parentPanel.OnRightPanelResize.RemoveAllListeners(); parentPanel.OnRightPanelResize.AddListener(twoViewVerticalLayout.OnParentPanelResize); thirdView.SetActiveAndSelect(false); twoViewVerticalLayout.MoveSplitterToCenter(); twoViewVerticalLayout.AllignPanelsWithSplitter(); } else if (firstView.isActiveAndEnabled) { DeactivateSlittedPanels(); RemoveSubscribers(twoViewHorizontalLayout, true); parentPanel.OnRightPanelResize.RemoveAllListeners(); parentPanel.OnRightPanelResize.AddListener(firstView.OnParentPanelResize); firstView.transform.SetParent(parentPanel.rightPanel.transform, false); thirdView.SetActiveAndSelect(false); firstView.SetActiveAndSelect(true); parentPanel.AllignPanelsWithSplitter(); } else if (secondView.isActiveAndEnabled) { DeactivateSlittedPanels(); RemoveSubscribers(twoViewHorizontalLayout, true); parentPanel.OnRightPanelResize.RemoveAllListeners(); parentPanel.OnRightPanelResize.AddListener(secondView.OnParentPanelResize); secondView.transform.SetParent(parentPanel.rightPanel.transform, false); thirdView.SetActiveAndSelect(false); secondView.SetActiveAndSelect(true); parentPanel.AllignPanelsWithSplitter(); } }
private void ActivateSecondView() { if (firstView.isActiveAndEnabled && thirdView.isActiveAndEnabled) { firstView.transform.SetParent(threeViewLayout23.leftPanel.transform, false); PanelWithHorizontalSplitter rightPanel = threeViewLayout23.rightPanel.GetComponentInChildren <PanelWithHorizontalSplitter>(); secondView.transform.SetParent(rightPanel.bottomPanel.transform, false); thirdView.transform.SetParent(rightPanel.topPanel.transform, false); RemoveSubscribers(twoViewVerticalLayout, true); threeViewLayout23.OnLeftPanelResize.AddListener(firstView.OnParentPanelResize); threeViewLayout23.OnRightPanelResize.AddListener(rightPanel.OnParentPanelResize); rightPanel.OnBottomPanelResize.AddListener(secondView.OnParentPanelResize); rightPanel.OnTopPanelResize.AddListener(thirdView.OnParentPanelResize); parentPanel.OnRightPanelResize.RemoveAllListeners(); parentPanel.OnRightPanelResize.AddListener(threeViewLayout23.OnParentPanelResize); DeactivateSlittedPanels(); secondView.SetActiveAndSelect(true); threeViewLayout23.gameObject.SetActive(true); //threeViewLayout23.splitter.transform.position = twoViewVerticalLayout.splitter.transform.position; threeViewLayout23.MoveSplitterToCenter(); rightPanel.MoveSplitterToCenter(); threeViewLayout23.AllignPanelsWithSplitter(); } else if (firstView.isActiveAndEnabled) { firstView.transform.SetParent(twoViewVerticalLayout.leftPanel.transform, false); secondView.transform.SetParent(twoViewVerticalLayout.rightPanel.transform, false); secondView.SetActiveAndSelect(true); DeactivateSlittedPanels(); twoViewVerticalLayout.gameObject.SetActive(true); RemoveSubscribers(twoViewVerticalLayout, true); twoViewVerticalLayout.OnLeftPanelResize.AddListener(firstView.OnParentPanelResize); twoViewVerticalLayout.OnRightPanelResize.AddListener(secondView.OnParentPanelResize); parentPanel.OnRightPanelResize.RemoveAllListeners(); parentPanel.OnRightPanelResize.AddListener(twoViewVerticalLayout.OnParentPanelResize); twoViewVerticalLayout.MoveSplitterToCenter(); twoViewVerticalLayout.AllignPanelsWithSplitter(); } else if (thirdView.isActiveAndEnabled) { thirdView.transform.SetParent(twoViewHorizontalLayout.topPanel.transform, false); secondView.transform.SetParent(twoViewHorizontalLayout.bottomPanel.transform, false); secondView.SetActiveAndSelect(true); DeactivateSlittedPanels(); twoViewHorizontalLayout.gameObject.SetActive(true); RemoveSubscribers(twoViewHorizontalLayout, true); twoViewHorizontalLayout.OnTopPanelResize.AddListener(thirdView.OnParentPanelResize); twoViewHorizontalLayout.OnBottomPanelResize.AddListener(secondView.OnParentPanelResize); parentPanel.OnRightPanelResize.RemoveAllListeners(); parentPanel.OnRightPanelResize.AddListener(twoViewHorizontalLayout.OnParentPanelResize); twoViewHorizontalLayout.MoveSplitterToCenter(); twoViewVerticalLayout.AllignPanelsWithSplitter(); } }