public void ShowOptionButtons()
        {
            //Debug.Log("NewGameFactionPanelController.ShowOptionButtons()");
            ClearOptionButtons();

            for (int i = 0; i < newGameManager.FactionList.Count; i++)
            {
                //Debug.Log("LoadGamePanel.ShowLoadButtonsCommon(): setting a button with saved game data");
                GameObject           go           = objectPooler.GetPooledObject(buttonPrefab, buttonArea.transform);
                NewGameFactionButton optionButton = go.GetComponent <NewGameFactionButton>();
                optionButton.Configure(systemGameManager);
                optionButton.AddFaction(newGameManager.FactionList[i]);
                optionButtons.Add(optionButton);
                uINavigationControllers[0].AddActiveButton(optionButton);
                if (newGameManager.FactionList[i] == newGameManager.Faction)
                {
                    uINavigationControllers[0].SetCurrentIndex(i);
                }
            }

            /*
             * if (optionButtons.Count > 0) {
             *  SetNavigationController(uINavigationControllers[0]);
             * }
             */
        }
 public void SetFaction(Faction newfaction)
 {
     //if (newfaction != null && SystemConfigurationManager.MyInstance.NewGameFaction == true) {
     if (SystemConfigurationManager.MyInstance.NewGameFaction == true)
     {
         factionLabel.SetActive(true);
         factionButton.gameObject.SetActive(true);
         factionButton.AddFaction(newfaction);
     }
     else
     {
         factionLabel.SetActive(false);
         factionButton.gameObject.SetActive(false);
     }
 }
Exemple #3
0
        public void ShowOptionButtonsCommon()
        {
            //Debug.Log("NewGameFactionPanelController.ShowOptionButtonsCommon()");
            ClearOptionButtons();

            foreach (Faction faction in SystemFactionManager.MyInstance.GetResourceList())
            {
                if (faction.NewGameOption == true)
                {
                    //Debug.Log("LoadGamePanel.ShowLoadButtonsCommon(): setting a button with saved game data");
                    GameObject           go           = Instantiate(buttonPrefab, buttonArea.transform);
                    NewGameFactionButton optionButton = go.GetComponent <NewGameFactionButton>();
                    optionButton.AddFaction(faction);
                    optionButtons.Add(optionButton);
                }
            }
            if (optionButtons.Count > 0)
            {
                optionButtons[0].Select();
            }
        }