Exemple #1
0
	void OnTriggerStay2D(Collider2D other)
	{
		if (other.gameObject.tag == "Player" && Input.GetKey(KeyCode.Space))
		{
			splatSound = GameObject.FindGameObjectWithTag ("SplatSound").GetComponentInParent<AudioSource>();
			splatSound.Play ();
			Debug.Log("punchable");
			die();
			if (this.gameObject.tag == "Boss") {
				threatSound = GameObject.FindGameObjectWithTag ("ThreatSound").GetComponentInParent<AudioSource>();
				threatSound.Play ();
				wave = GameObject.FindGameObjectWithTag ("WaveSpawner").GetComponent<WaveSpawner>();
				wave.setWin (true);
			}
		}
	}