Use the sounds (broken)
This commit is contained in:
parent
ace7e83ff2
commit
17e1ab02df
6 changed files with 35 additions and 7 deletions
|
@ -57,10 +57,17 @@ public class AudioControl : MonoBehaviour
|
|||
soundeffects[sound].Play();
|
||||
}
|
||||
|
||||
public void SfxPlay(Sfx sound) {
|
||||
Debug.Log("Playing " + sound + " " + (int)sound);
|
||||
SfxPlay((int)sound);
|
||||
}
|
||||
|
||||
public void SfxStop(int sound)
|
||||
{
|
||||
soundeffects[sound].Stop();
|
||||
}
|
||||
|
||||
|
||||
public bool SfxPlaying(int sound)
|
||||
{
|
||||
return soundeffects[sound].isPlaying;
|
||||
|
|
|
@ -27,13 +27,13 @@ namespace Assets.Scripts.Entities.Attack {
|
|||
public void Attack() {
|
||||
if ( bulletPrefab == null )
|
||||
return;
|
||||
GameObject b = GameObject.Instantiate(bulletPrefab);
|
||||
GameObject b = UnityEngine.Object.Instantiate(bulletPrefab);
|
||||
b.transform.rotation = spawn.rotation;
|
||||
b.transform.position = spawn.position;
|
||||
Bullet bu = b.GetComponent<Bullet>();
|
||||
bu.SetDamage(damage);
|
||||
bu.SetOwner(owner);
|
||||
GameController.instance.GetAudioControl().SfxPlay(0);
|
||||
GameController.instance.GetAudioControl().SfxPlay(AudioControl.Sfx.shoot);
|
||||
}
|
||||
|
||||
public float GetCooldownTime() {
|
||||
|
|
|
@ -31,6 +31,8 @@ public abstract class Mob : Entity {
|
|||
if ( !isDead && currentHP <= 0 ) {
|
||||
isDead = true;
|
||||
Death();
|
||||
} else if (! isDead) {
|
||||
GameController.instance.GetAudioControl().SfxPlay(AudioControl.Sfx.mobattack);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,6 +42,7 @@ public abstract class Mob : Entity {
|
|||
protected virtual void Death() {
|
||||
if ( objective != null )
|
||||
objective.RemoveEntity(this);
|
||||
GameController.instance.GetAudioControl().SfxPlay(AudioControl.Sfx.explosion);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
|
|
|
@ -107,6 +107,7 @@ public class Room : MonoBehaviour {
|
|||
foreach ( Door d in doors ) {
|
||||
d.Lock();
|
||||
}
|
||||
GameController.instance.GetAudioControl().SfxPlay(AudioControl.Sfx.door);
|
||||
Debug.Log("[ROOMS] Locked all doors...");
|
||||
}
|
||||
|
||||
|
@ -117,6 +118,7 @@ public class Room : MonoBehaviour {
|
|||
foreach ( Door d in doors ) {
|
||||
d.Unlock();
|
||||
}
|
||||
GameController.instance.GetAudioControl().SfxPlay(AudioControl.Sfx.door);
|
||||
Debug.Log("[ROOMS] Unlocked all doors...");
|
||||
}
|
||||
|
||||
|
|
8
Assets/graphics/textures/car.meta
Normal file
8
Assets/graphics/textures/car.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9ec323b9157704d00a3409f8ea6e46b2
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
8
Assets/graphics/textures/tmp.meta
Normal file
8
Assets/graphics/textures/tmp.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: df6e7833427b5497b92308fb6f54e552
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Reference in a new issue