public void NextLevel() { audioNextLevel = audioNextLevel.GetComponent <AudioSource>(); audioNextLevel.PlayDelayed(0f); audioCity.Pause(); ImageEndGame.SetActive(true); }
//when the player clicks the last Image close the game public void ImageEndGame_Onclick() { audioInfoImage = audioInfoImage.GetComponent <AudioSource>(); audioInfoImage.PlayDelayed(0f); ImageEndGame.SetActive(false); Application.Quit(); }
public void Inform(ScoreType st, float delta) { ActualResults[st].Value += delta; if (Mission != null) { MissionStatus ms = Mission.GetStatus(ActualResults); if (ms == MissionStatus.Success || ms == MissionStatus.Failure) { bool isSuccess = Mission.GetStatus(ActualResults) == MissionStatus.Success; Game.Me.GetComponent <GoogleAnalyticsV3>().LogEvent("Finished " + Mission.MissionType + " " + (isSuccess?"Success":"Failure"), Mission.Name, ActualResults[ScoreType.Interventions].Value.ToString(), (long)(ActualResults[ScoreType.Time].Value * 1000)); Game.Me.MinigameFinished(ActualResults, Mission); ImageEndGame.SetActive(true); TextEndGame.GetComponent <Text>().text = "Mission " + (isSuccess ? "Success" : "Failure") + "\n"; Mission = null; } } }
public void PrepareGame(Mission m) { ImageEndGame.SetActive(false); ActualResults.Clear(); ActualResults.Add(ScoreType.Interventions, new Result(ScoreType.Interventions, 0)); ActualResults.Add(ScoreType.Population, new Result(ScoreType.Population, 0)); //buildings will inform about population change ActualResults.Add(ScoreType.Time, new Result(ScoreType.Time, 0)); Game.Me.GetComponent <GoogleAnalyticsV3>().LogScreen(m.MissionType.ToString()); ScoreTypeListeners.Clear(); ScoreTypeListeners.Add(this); this.Clear(ScoreType.Interventions); this.Clear(ScoreType.Time); NumberShower nsi = PanelTop.GetComponent <PanelTop>().TextInterventions.GetComponent <NumberShower>(); int interventions = 0; foreach (AchievQuery aq in m.FailureQueries) { if (aq.ScoreType == ScoreType.Interventions) { interventions = (int)aq.Value; } } nsi.Clear(ScoreType.Interventions); nsi.Inform(ScoreType.Interventions, -interventions); ScoreTypeListeners.Add(nsi); NumberShower nsp = PanelTop.GetComponent <PanelTop>().TextPopulation.GetComponent <NumberShower>(); nsp.Clear(ScoreType.Population); ScoreTypeListeners.Add(nsp); GetComponentInChildren <ScrollableList>().Build(m.Buildings, ScoreTypeListeners); Mission = m; }