// Use this for initialization void Start() { gm = GameObject.FindGameObjectWithTag ("AsteroidGameManager").GetComponent<AsteroidGameManager> (); player = GameObject.FindGameObjectWithTag ("Player").GetComponent<AsteroidPlayerShip> (); asteroidScore = GameObject.FindGameObjectWithTag ("AsteroidScore").GetComponent<AsteroidScore> (); // stats = GameObject.FindGameObjectWithTag ("AsteroidGameManager").GetComponent<Stats> (); }
public void PlayerDied(AsteroidScore score) { // This simply reloads level 0. // TODO Make this a bit more proper. Instantiate (gameOverSound); Invoke ("ReloadLevel", 3f); gameOverText.gameObject.SetActive (true); }
private bool _isDestroyed = false; //Используется для исправления бага со спавном нескольких пар астеройдов private void Start() { _asteroidScore = _asteroidScorePrefab.GetComponent <AsteroidScore>(); _rigidbody = GetComponent <Rigidbody2D>(); _asteroidsParent = transform.parent; Move(); Destroy(gameObject, 25f); }
// Use this for initialization void Start() { startscreen = GameObject.Find ("startscreen").GetComponent<SpriteRenderer> (); startGameObject = GameObject.Find ("startscreen"); // Spawn "i" - number of asteroids at the start of game. for (int i = 0 ; i < startingAsteroids ; ++i) { SpawnAsteroid(); SpawnArtifact(); } asteroidScore = GameObject.FindGameObjectWithTag ("AsteroidScore").GetComponent<AsteroidScore> (); player = GameObject.FindGameObjectWithTag ("Player").GetComponent<AsteroidPlayerShip> (); }
// Use this for initialization void Start() { asteroidScore = GameObject.FindGameObjectWithTag ("AsteroidScore").GetComponent<AsteroidScore> (); gm = GameObject.FindGameObjectWithTag ("AsteroidGameManager").GetComponent<AsteroidGameManager> (); }