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)
        {
            //Debug.Log("NewGameFactionPanelController.SetFaction(" + newFaction.DisplayName + ")");

            // deselect old button
            if (selectedFactionButton != null && selectedFactionButton.Faction != newFaction)
            {
                selectedFactionButton.DeSelect();
                selectedFactionButton.UnHighlightBackground();
            }

            // select new button
            for (int i = 0; i < optionButtons.Count; i++)
            {
                if (optionButtons[i].Faction == newFaction)
                {
                    selectedFactionButton = optionButtons[i];
                    uINavigationControllers[0].SetCurrentIndex(i);
                    optionButtons[uINavigationControllers[0].CurrentIndex].HighlightBackground();
                }
            }

            ShowAbilityRewards();
            ShowTraitRewards();
        }
Exemple #3
0
        public void ShowFaction(NewGameFactionButton factionButton)
        {
            //Debug.Log("LoadGamePanel.ShowSavedGame()");
            if (selectedFactionButton != null && selectedFactionButton != this)
            {
                selectedFactionButton.DeSelect();
            }

            selectedFactionButton = factionButton;
            faction = factionButton.Faction;
            ShowAbilityRewards();
            ShowTraitRewards();
        }
Exemple #4
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();
            }
        }