// 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;
 }
예제 #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>();
    }
예제 #3
0
 private void Start()
 {
     _spawnGameObjectsScript = GameObject.FindGameObjectWithTag("Spawner").GetComponent <SpawnGameObjects>();
 }
예제 #4
0
파일: Spider.cs 프로젝트: Tb95/GGJ2016
 public void SetSpawner(SpawnGameObjects spawner)
 {
     this.spawner = spawner;
 }