Music Update

This commit is contained in:
JonatanRek
2020-02-01 20:36:50 +01:00
parent 07ec5427a4
commit 046306f6f4
5 changed files with 216 additions and 8 deletions

View File

@@ -10,6 +10,9 @@ public class BarricadeManager : MonoBehaviour
public OffMeshLink offMeshLink;
public Transform walkPoint;
public AudioSource audioSource = new AudioSource();
public AudioClip buildSound;
// Start is called before the first frame update
void Start()
{
@@ -37,6 +40,7 @@ public class BarricadeManager : MonoBehaviour
public void addPlank()
{
if (health < (barricadePlanks.Count * 50)) {
audioSource.PlayOneShot(buildSound);
health += 50;
offMeshLink.enabled = false;
}

View File

@@ -14,6 +14,9 @@ public class BlockManager : MonoBehaviour
private bool action = false;
public List<GameObject> amountModels = new List<GameObject>();
public AudioSource audioSource = new AudioSource();
public AudioClip doorSound;
// Start is called before the first frame update
void Start()
{
@@ -97,6 +100,7 @@ public class BlockManager : MonoBehaviour
{
if (!animation.isPlaying)
{
audioSource.PlayOneShot(doorSound);
if (!action)
{
animation["Door"].speed = 1;