public void ShowOptionButtonsCommon() { //Debug.Log("NewGameMecanimCharacterPanelController.ShowOptionButtonsCommon()"); ClearOptionButtons(); if ((NewGamePanel.MyInstance.Faction != null && NewGamePanel.MyInstance.Faction.HideDefaultProfiles == false) || SystemConfigurationManager.MyInstance.AlwaysShowDefaultProfiles == true) { //Debug.Log("NewGameMecanimCharacterPanelController.ShowOptionButtonsCommon(): showing default profiles"); foreach (UnitProfile unitProfile in SystemConfigurationManager.MyInstance.CharacterCreatorProfiles) { //Debug.Log("NewGameMecanimCharacterPanelController.ShowOptionButtonsCommon(): found valid unit profile: " + unitProfile.DisplayName); GameObject go = Instantiate(buttonPrefab, buttonArea.transform); NewGameUnitButton optionButton = go.GetComponent <NewGameUnitButton>(); optionButton.AddUnitProfile(unitProfile); optionButtons.Add(optionButton); } } if (NewGamePanel.MyInstance.Faction != null) { foreach (UnitProfile unitProfile in NewGamePanel.MyInstance.Faction.CharacterCreatorProfiles) { //Debug.Log("NewGameMecanimCharacterPanelController.ShowOptionButtonsCommon(): found valid unit profile: " + unitProfile.DisplayName); GameObject go = Instantiate(buttonPrefab, buttonArea.transform); NewGameUnitButton optionButton = go.GetComponent <NewGameUnitButton>(); optionButton.AddUnitProfile(unitProfile); optionButtons.Add(optionButton); } } if (optionButtons.Count > 0) { optionButtons[0].Select(); } }
private void AddDefaultProfiles() { if (SystemConfigurationManager.MyInstance.DefaultPlayerUnitProfile != null) { GameObject go = Instantiate(buttonPrefab, buttonArea.transform); NewGameUnitButton optionButton = go.GetComponent <NewGameUnitButton>(); optionButton.AddUnitProfile(SystemConfigurationManager.MyInstance.DefaultPlayerUnitProfile); optionButtons.Add(optionButton); } foreach (UnitProfile unitProfile in SystemConfigurationManager.MyInstance.CharacterCreatorProfiles) { //Debug.Log("NewGameMecanimCharacterPanelController.ShowOptionButtonsCommon(): found valid unit profile: " + unitProfile.DisplayName); GameObject go = Instantiate(buttonPrefab, buttonArea.transform); NewGameUnitButton optionButton = go.GetComponent <NewGameUnitButton>(); optionButton.AddUnitProfile(unitProfile); optionButtons.Add(optionButton); } }
public void ShowOptionButtons() { //Debug.Log("NewGameMecanimCharacterPanelController.ShowOptionButtons()"); ClearOptionButtons(); for (int i = 0; i < newGameManager.UnitProfileList.Count; i++) { //Debug.Log("NewGameMecanimCharacterPanelController.ShowOptionButtonsCommon(): found valid unit profile: " + unitProfile.DisplayName); GameObject go = objectPooler.GetPooledObject(buttonPrefab, buttonArea.transform); NewGameUnitButton optionButton = go.GetComponent <NewGameUnitButton>(); optionButton.Configure(systemGameManager); optionButton.AddUnitProfile(newGameManager.UnitProfileList[i]); optionButtons.Add(optionButton); uINavigationControllers[0].AddActiveButton(optionButton); } /* * if (optionButtons.Count > 0) { * SetNavigationController(uINavigationControllers[0]); * } */ }