public void Init(God god) { List <Tuple <SquadDefinition, SquadFakeData> > displayedSquads = GetDisplayedSquads(god); for (int i = 0; i < m_fakeData.squadNbElementLockedBefore; i++) { CharacterPanel characterPanel = CreateCharacterPanel(); characterPanel.Set(null, null); m_characterList.Add(characterPanel); } int count = displayedSquads.Count; for (int j = 0; j < count; j++) { Tuple <SquadDefinition, SquadFakeData> tuple = displayedSquads[j]; CharacterPanel characterPanel2 = CreateCharacterPanel(); characterPanel2.Set(tuple.Item1, tuple.Item2); m_characterList.Add(characterPanel2); } for (int k = 0; k < m_fakeData.squadNbElementLockedAfter; k++) { CharacterPanel characterPanel3 = CreateCharacterPanel(); characterPanel3.Set(null, null); m_characterList.Add(characterPanel3); } m_characterList.lockedLeft = m_fakeData.squadNbElementLockedBefore; m_characterList.lockedright = m_fakeData.squadNbElementLockedAfter; m_characterList.SetSelectedIndex(GetSelectedIndex(displayedSquads), tween: false, selectCallback: false); m_selectButton.set_interactable(displayedSquads.Count > 0); m_displayedSquad = displayedSquads; }
private CharacterPanel CreateCharacterPanel() { CharacterPanel characterPanel = Object.Instantiate <CharacterPanel>(m_characterPrefab); characterPanel.get_gameObject().SetActive(true); return(characterPanel); }