void Awake() { gm = GameObject.Find("NNGameManager").GetComponent <NNGameManager>(); pipeSpawner = GameObject.Find("PipeSpawner").GetComponent <PipeSpawner>(); score = 0; fitness = 0; nn = new NeuralNetwork(); scoreText = GameObject.Find("DummyScore").GetComponent <Text>(); fitnessText = GameObject.Find("DummyFitness").GetComponent <Text>(); }
void Awake() { Time.timeScale = timeScale; DontDestroyOnLoad(this.gameObject); if (instance == null) { instance = this; SceneManager.sceneLoaded += OnSceneLoad; population = new Population(populationSize, nnBirdPrefab); population.Init(); } else { Destroy(gameObject); } }