Added audio, it's finished

This commit is contained in:
2020-04-19 09:22:26 +10:00
parent 499d572dfb
commit 71ec83ec7e
25 changed files with 476 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ using UnityEngine;
public class Tree : MonoBehaviour {
static LevelController levelController;
static AudioController audioController;
static GameObject character;
SpriteRenderer spriteRenderer;
@@ -19,6 +20,10 @@ public class Tree : MonoBehaviour {
levelController = GameObject.Find("Level Controller").GetComponent<LevelController>();
}
if (!audioController) {
audioController = GameObject.Find("AudioController").GetComponent<AudioController>();
}
if (!character) {
character = GameObject.Find("Character");
}
@@ -28,6 +33,8 @@ public class Tree : MonoBehaviour {
if (GamePad.GetState().Pressed(CButton.Y)) {
life -= 1;
audioController.Play("cut");
//wiggle
StartCoroutine(Wiggle());