void Awake() { if (instance != null) { Destroy(gameObject); return; } instance = this; }
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; }
// Start is called before the first frame update void Awake() { numberShower = GetComponent <NumberShower>(); }