Beispiel #1
0
	public void setButton(mortyButton button, bool state){
		button.btn.interactable = state;
		button.cooldown = !state; 
	}
Beispiel #2
0
	// Use this for initialization
	void Start () {
		soundfx = GetComponent<AudioSource>();
		allyTowerScript = allyTower.GetComponent<AllyTowerScript> ();

		regMortyBtn = new mortyButton(regMortyButton);
		frozenMortyBtn = new mortyButton (frozenMortyButton);
		karateMortyBtn = new mortyButton (karateMortyButton);
		shadowMortyBtn = new mortyButton (shadowMortyButton);
		wrestlerMortyBtn = new mortyButton (wrestlerMortyButton);

		gold = 30;

		restartButton.gameObject.SetActive(false);
		waveText.enabled = false;
		StartCoroutine(spawnWave());

		//set the unlock message
		frozenMortyText = frozenMortyLabel.GetComponent<Text> ().text;
		frozenMortyLabel.GetComponent<Text>().text = "Unlock with " + 3*frozenMortyCost + "G\nFrozen Morty (2)\nSlow units for 2s \nWeak against Prax";

		karateMortyText = karateMortyLabel.GetComponent<Text> ().text;
		karateMortyLabel.GetComponent<Text>().text = "Unlock with " + 3*karateMortyCost + "G\nKarate Morty (3)\nHigh damage and Speed\nLow health ";

		shadowMortyText = shadowMortyLabel.GetComponent<Text> ().text;
		shadowMortyLabel.GetComponent<Text>().text = "Unlock with " + 3*shadowMortyCost + "G\nShadow Morty (4)\nAvoids small units\nWeak against Goob";

		wrestlerMortyText = wrestlerMortyLabel.GetComponent<Text> ().text;
		wrestlerMortyLabel.GetComponent<Text> ().text = "Unlock with " + 3*wrestlerMortyCost + "G\nWrestler Morty (5)\nHigh health\nSlow speed ";
	}
Beispiel #3
0
	IEnumerator spawnDelay(mortyButton btn, int delayTime){
		soundfx.PlayOneShot (mortySpawn, 0.5f);
		setButton(btn, false);
		yield return new WaitForSeconds(delayTime);
		setButton (btn, true);
	}