示例#1
0
 // 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> ();
 }
示例#2
0
 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);
 }
示例#3
0
    private bool _isDestroyed = false; //Используется для исправления бага со спавном нескольких пар астеройдов

    private void Start()
    {
        _asteroidScore   = _asteroidScorePrefab.GetComponent <AsteroidScore>();
        _rigidbody       = GetComponent <Rigidbody2D>();
        _asteroidsParent = transform.parent;
        Move();
        Destroy(gameObject, 25f);
    }
示例#4
0
 // 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> ();
 }
示例#5
0
 // Use this for initialization
 void Start()
 {
     asteroidScore = GameObject.FindGameObjectWithTag ("AsteroidScore").GetComponent<AsteroidScore> ();
     gm = GameObject.FindGameObjectWithTag ("AsteroidGameManager").GetComponent<AsteroidGameManager> ();
 }