Exemplo n.º 1
0
 /// <summary>
 /// Switch to a UIGroup linked in editor by using a direct object reference.
 /// </summary>
 /// <param name="nextUIGroup">Reference to the UIGroup to swtich to.</param>
 /// <param name="clearPreviousGroup">Boolean to determine of the active UIElement in the previous UIGroup should be cleared.</param>
 public void NavToUIGroup(UIGroup nextUIGroup, bool clearPreviousGroup = false)
 {
     if (nextUIGroup != activeGroup)
     {
         previousGroup = activeGroup;
         activeGroup = nextUIGroup;
         Debug.Log("PreviousGroup: " + previousGroup);
         Debug.Log("ActiveGroup: " + nextUIGroup);
         if (previousGroup == null)
         {
             uiMainMenu.Deactivate();
         }
         else
         {
             previousGroup.Deactivate();
             if (clearPreviousGroup)
             {
                 previousGroup.ClearActiveUI();
             }
         }
         activeGroup.Activate();
         mainMenuButton.gameObject.SetActive(true);
     }
 }