/// <summary> /// Muestra la informacion de la primera mision /// </summary> public void SeleccionarMisionDefault() { // obtiene las referencias a los elementos de esta interfaz GetReferencias(); // seleccionar la primera mision y actualizar los botones //m_numCurrentMission = 0; SetLastMissionOfLevel(m_numCurrentLevel); UpdateMissionButtons(); // dejar seleccionada la primera levelmission de la pagina GameLevel gameLevel = MissionManager.instance.GetGameLevel(m_numCurrentLevel); ShowLevelMission(gameLevel.GetGameLevelMission(m_numCurrentMission), m_numCurrentMission); MostrarBotonSeleccionado(m_numCurrentMission); }
private void UpdateMissionButtons() { GameLevel gameLevel = MissionManager.instance.GetGameLevel(m_numCurrentLevel); // actualizar la pagina de misiones for (int i = 0; i < m_missionButtons.Length; ++i) { GameLevelMission glm = gameLevel.GetGameLevelMission(i); bool misionDesbloqueada = (m_numCurrentLevel * 10 + i) <= Interfaz.ultimaMisionDesbloqueada; m_missionButtons[i].Init(glm.Index, glm, misionDesbloqueada); } // actualizar la pagina de misiones /* * GameLevel gameLevel = MissionManager.instance.GetGameLevel(m_numCurrentLevel); * for ( int i = 0; i < NUM_MISSIONS_PAGE; ++i ) { * if ( i < gameLevel.numMissions && Interfaz.ultimaMisionDesbloqueada >= gameLevel.GetGameLevelMission(i).Index) { * btnMissionButton bm = m_missionButtons[ i ]; * GameLevelMission glm = gameLevel.GetGameLevelMission(i); * int numBoton = i; * bm.Init( ( i + 1 ).ToString(), glm.MissionGameMode, * glm.MissionUnlocked, glm.numEstrellas, * (_name) => { * ShowLevelMission(glm); * MostrarBotonSeleccionado(numBoton); * } ); * m_missionButtons[ i ].gameObject.SetActive( true ); * } * else { * m_missionButtons[ i ].gameObject.SetActive( false ); * } * } */ }