// Use this for initialization
 void Start()
 {
     if (sgm == null)
         sgm = this.gameObject.GetComponent<SpawnGameObjects> ();
     // determine when to spawn the next object
     nextSpawnTime = Time.time+secondsBetweenSpawning;
 }
Esempio n. 2
0
    // setup the game
    void Start()
    {
        // get a reference to the GameManager component for use by other scripts
        if (gm == null)
        {
            gm = this;
        }

        gameState = GameState.menu;

        if (!PlayerPrefs.HasKey("HighScore"))
        {
            PlayerPrefs.SetInt("HighScore", 0);
        }

#if UNITY_STANDALONE || UNITY_EDITOR || UNITY_WEBGL
        ml = Player.GetComponent <MouseLooker>();
#endif
        sp = Spawner.GetComponent <SpawnGameObjects>();
    }
Esempio n. 3
0
 private void Start()
 {
     _spawnGameObjectsScript = GameObject.FindGameObjectWithTag("Spawner").GetComponent <SpawnGameObjects>();
 }
Esempio n. 4
0
 public void SetSpawner(SpawnGameObjects spawner)
 {
     this.spawner = spawner;
 }