-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
- Bug Fixes - Extra Audio (foot steps, Attack VFX, Fight music) - Esc button (Reset the game and back to Main menu)
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.SceneManagement; | ||
using UnityEngine.UI; | ||
|
||
public class ActionZone : MonoBehaviour | ||
{ | ||
|
||
AudioSource audioSource; | ||
public AudioClip audioClip; | ||
|
||
void Start() | ||
{ | ||
audioSource = GetComponent<AudioSource>(); | ||
} | ||
|
||
private void OnTriggerEnter2D(Collider2D collision) | ||
{ | ||
audioSource.PlayOneShot(audioClip, 0.7F); | ||
} | ||
|
||
void OnTriggerExit2D(Collider2D other) | ||
{ | ||
audioSource.Stop(); | ||
} | ||
|
||
|
||
|
||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class AttackVFX : MonoBehaviour | ||
{ | ||
|
||
AudioSource audioSource; | ||
public AudioClip attackA; | ||
|
||
void Start() | ||
{ | ||
audioSource = GetComponent<AudioSource>(); | ||
} | ||
|
||
void Update() | ||
{ | ||
if (Input.GetKeyDown("f")) | ||
{ | ||
|
||
audioSource.PlayOneShot(attackA, 0.7F); | ||
} | ||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.SceneManagement; | ||
|
||
public class Pause : MonoBehaviour | ||
{ | ||
|
||
|
||
void Update() | ||
{ | ||
if (Input.GetKeyDown(KeyCode.Escape)) | ||
{ | ||
SceneManager.LoadScene("Menu_Start"); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
|
||
public class PlayerFootstepSound : MonoBehaviour | ||
{ | ||
List<UnityEngine.KeyCode> keys = new List<UnityEngine.KeyCode>(); | ||
|
||
private AudioSource audioSource; | ||
public AudioClip steps; | ||
|
||
void Start() | ||
{ | ||
audioSource = gameObject.GetComponent<AudioSource>(); | ||
|
||
keys.Add(KeyCode.W); | ||
keys.Add(KeyCode.S); | ||
keys.Add(KeyCode.A); | ||
keys.Add(KeyCode.D); | ||
keys.Add(KeyCode.UpArrow); | ||
keys.Add(KeyCode.DownArrow); | ||
keys.Add(KeyCode.LeftArrow); | ||
keys.Add(KeyCode.RightArrow); | ||
} | ||
|
||
void Update() | ||
{ | ||
if (keys.Exists(key => Input.GetKeyDown(key))) | ||
{ | ||
audioSource.PlayOneShot(steps, 0.7F); | ||
} | ||
|
||
|
||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.