//Awake is always called before any Start functions void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); scoreText.text = ""; if (restartText) { restartText.text = "1/1"; } if (gameOverText) { gameOverText.text = ""; } evolEngine = this.GetComponentInParent <EvolutionState> (); BatchmodeConfig.HandleArgs(evolEngine, this); lvl = new Level(); lvl.load(levelNumber); evolEngine.populationSize = 50; evolEngine.individualSize = lvl.calcNumberOfMoves(); evolEngine.InitPopulation(); init(); }