Exemplo n.º 1
0
	//------------------------------------------------------------------------------------------------------------------
	// A aranha morre
	//------------------------------------------------------------------------------------------------------------------
	public void die(){
		if(dead) return;
		dead = true;
		collider2D.enabled = false;
		soundToPlay = SpiderSound.death;
		audio.volume = ApplicationModel.SaveData.Volume;
		if(audio.clip != roarAudio) audio.clip = roarAudio;
		audio.pitch = 1.0f;
		audio.Play();
	}
Exemplo n.º 2
0
	//------------------------------------------------------------------------------------------------------------------
	// Exibe o emoticon Wut
	//------------------------------------------------------------------------------------------------------------------
	void callWut(){
		if(wuted) return;
		soundToPlay = SpiderSound.wut;
		Instantiate(wut,transform.position + new Vector3(0,0.5f,0),Quaternion.identity);
		wuted = true;
	}
Exemplo n.º 3
0
	//------------------------------------------------------------------------------------------------------------------
	// A aranha atira no jogador
	//------------------------------------------------------------------------------------------------------------------
	void shootAtPlayer(){
		if(++shotCooldownCount >= shotCooldown) shotCooldownCount = 0;
		if(shotCooldownCount<= 0){
			bulletType.GetComponent<Gunshot>().copyBullet(
				bulletSpawner.transform.position,
				spiderArm.transform.localEulerAngles.z,
				(int)Mathf.Sign(transform.localScale.x)<0
				);
			soundToPlay = SpiderSound.gunshot;
		}
	}
Exemplo n.º 4
0
	//------------------------------------------------------------------------------------------------------------------
	// Exibe o emoticon Hey
	//------------------------------------------------------------------------------------------------------------------
	void callHey(){
		if(heyed) return;
		soundToPlay = SpiderSound.hey;
		Instantiate(hey,transform.position + new Vector3(0,0.5f,0),Quaternion.identity);
		heyed = true;
	}
Exemplo n.º 5
0
	//------------------------------------------------------------------------------------------------------------------
	// Toca o som pertinente ao momento
	//------------------------------------------------------------------------------------------------------------------
	void playSound(){
		switch(soundToPlay){
		case SpiderSound.gunshot:
			if(audio.clip != shootingAudio) audio.clip = shootingAudio;
			audio.pitch = Random.Range(1.0f,2.0f);
			audio.volume = ApplicationModel.SaveData.Volume;
			audio.Play();
			break;
		case SpiderSound.hey:
			if(audio.clip != emoticonAudio) audio.clip = emoticonAudio;
			audio.volume = ApplicationModel.SaveData.Volume;
			audio.pitch = Random.Range(2.0f,3.0f);
			audio.Play();
			break;
		case SpiderSound.wut:
			if(audio.clip != emoticonAudio) audio.clip = emoticonAudio;
			audio.volume = ApplicationModel.SaveData.Volume;
			audio.pitch = Random.Range(0.5f,1.5f);
			audio.Play();
			break;
		}
		soundToPlay = SpiderSound.nothing;
	}