// 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; }
// 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>(); }
private void Start() { _spawnGameObjectsScript = GameObject.FindGameObjectWithTag("Spawner").GetComponent <SpawnGameObjects>(); }
public void SetSpawner(SpawnGameObjects spawner) { this.spawner = spawner; }