Esempio n. 1
0
 void Start()
 {
     mobStats        = GetComponent <MobStats> ();
     waveStats       = GetComponent <WaveStats> ();
     waypointManager = GetComponent <WaypointManager> ();
     canvas          = GameObject.Find("Canvas");
 }
Esempio n. 2
0
 void Start()
 {
     //not in a wave
     waveActive = false;
     //game isn't active
     gameStarted = false;
     //mobs not spawning
     waveSpawning = false;
     //get scripts
     mapWaves     = GetComponent <MapWaves> ();
     mobStats     = GetComponent <MobStats> ();
     mobSpawner   = GetComponent <MobSpawner> ();
     levelmanager = GetComponent <TDLevelManager> ();
     waveRecord   = PlayerPrefs.GetInt(levelmanager.mapName + "Waves");
     //set display
     tmProCountdown = countdownTimer.GetComponent <TextMesh>();
     //currently only made it to wave 1
     highestWave = 1;
     //all mob info 0 to start
     mobStats.mobsCurrentlyActive = 0;
     mobStats.mobsSpawnedThisWave = 0;
     mapWaves.CountdownOne();
     tmProWaveCounter.text = 1.ToString ();
     tmProMobCounter.text  = waveOneMobs.ToString();
     if (freebuild)
     {
         if (PlayerPrefs.HasKey("name"))
         {
             playerName = PlayerPrefs.GetString("name");
         }
     }
 }
Esempio n. 3
0
 public void GemStart()
 {
     levelManagerObject = GameObject.Find("LevelManager");
     levelManager       = levelManagerObject.GetComponent <TDLevelManager> ();
     mobStats           = levelManagerObject.GetComponent <MobStats> ();
     waveStats          = levelManagerObject.GetComponent <WaveStats> ();
     currentHealth      = maxHealth;
     gemCanvas          = GetComponentInChildren <Canvas>().gameObject;
     gemCanvas.SetActive(true);
 }