Ejemplo n.º 1
0
    /**
     * Shows the panel with the given id and hides the active one
     */
    public void Show(Enum.Panel panel)
    {
        if (this.activePanel != panel)
        {
            this.GetPanel(this.activePanel).Disable();
        }

        this.GetPanel(panel).Enable();
        this.activePanel = panel;
    }
Ejemplo n.º 2
0
    /**
     * Returns the panel by the given panel type
     */
    public Panel GetPanel(Enum.Panel panel)
    {
        for (var index = 0; index < this.panelArray.Length; index++)
        {
            if (this.panelArray[index].panel == panel)
            {
                return(this.panelArray[index]);
            }
        }

        throw new UnityException("Panel not found!");
    }
Ejemplo n.º 3
0
 /**
  * Returns the panel by the given panel type
  */
 public Type GetPanel <Type>(Enum.Panel panel) where Type : Panel
 {
     return((Type)this.GetPanel(panel));
 }