UnityMol  0.9.6-875
UnityMol viewer / In developement
PanelManager.cs
Go to the documentation of this file.
1 using UnityEngine;
2 using System.Collections;
3 using UnityEngine.UI;
4 using UI;
5 
6 public class PanelManager : MonoBehaviour {
7  public GameObject sidePanel;
8  public GameObject canvas;
9 
14 
15  public void UpdateCurrentPanel(RectTransform toActivate)
16  {
17  // If the panel is not active, set him active
18  if (!sidePanel.activeSelf) {
19  sidePanel.SetActive(true);
20  }
21 
22  //Set inactive all children except the one linked to the button.
23  foreach(Transform child in transform)
24  {
25  if(child == toActivate)
26  {
27  child.gameObject.SetActive(true);
28  }
29  else {
30  child.gameObject.SetActive(false);
31  }
32  }
33  }
34 
35  public void hideShowNewUI(bool show)
36  {
37  PanelManager uiMan = GameObject.Find ("UIManager").GetComponent<PanelManager>();
38  UIData.hiddenUI = show;
39  uiMan.canvas.SetActive(show);
40  }
41 
42 }
void hideShowNewUI(bool show)
Definition: PanelManager.cs:35
GameObject sidePanel
Definition: PanelManager.cs:7
GameObject canvas
Definition: PanelManager.cs:8
!WiP Includes FLAGS of GUI.
Definition: UIData.cs:78
static bool hiddenUI
Definition: UIData.cs:161
void UpdateCurrentPanel(RectTransform toActivate)
Updates the current panel.
Definition: PanelManager.cs:15
Definition: GUIDisplay.cs:66