void Start() { _playableGOMovement = _playerGO.GetComponent <PlayableGOMovement>(); _planetBehaviour = _planetGO.GetComponent <PlanetBehaviour>(); _scoreText.text = "Score: " + _score; _looseText.gameObject.SetActive(false); _audioScore = gameObject.GetComponentInChildren <AudioSource>(); _shipIndex = PlayerPrefs.GetInt("shipIndex"); Transform rootSpaceShipsGO = _playerGO.transform.GetChild(0); for (int i = 0; i < rootSpaceShipsGO.transform.childCount; i++) { _shipsGOs.Add(rootSpaceShipsGO.GetChild(i).gameObject); if (i == PlayerPrefs.GetInt("shipIndex")) { _shipsGOs[i].SetActive(true); } else { _shipsGOs[i].SetActive(false); } } if (!_testMode) { StartCoroutine("spawnEnemy"); } }
void Start() { _playableGOMovement = GetComponent <PlayableGOMovement>(); _halfWidthScreen = SceneBehaviour._screenWidth / 2.0f; }