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(); } }
public void SetBody(NewGameUnitButton newGameUnitButton) { if (selectedUnitButton != null && selectedUnitButton != newGameUnitButton) { selectedUnitButton.DeSelect(); } selectedUnitButton = newGameUnitButton; }
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 SetUnitProfile(UnitProfile newUnitProfile) { //Debug.Log("NewGameMecanimCharacterPanelController.SetUnitProfile(" + (newUnitProfile == null ? "null" : newUnitProfile.DisplayName) + ")"); // deselect old button if (selectedUnitButton != null && selectedUnitButton.UnitProfile != newUnitProfile) { selectedUnitButton.DeSelect(); selectedUnitButton.UnHighlightBackground(); } // select new button for (int i = 0; i < optionButtons.Count; i++) { if (optionButtons[i].UnitProfile == newUnitProfile) { selectedUnitButton = optionButtons[i]; uINavigationControllers[0].SetCurrentIndex(i); optionButtons[i].HighlightBackground(); } } }
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]); * } */ }