Implemented as much audio as I could given the drafts/snippets of audio I've been given by Andrew

This commit is contained in:
Gregory Campbell
2020-07-07 20:13:52 -04:00
parent 6933331f45
commit e9d7e90e27
21 changed files with 469 additions and 1 deletions
+25 -1
View File
@@ -47,6 +47,8 @@ public class GMScript : MonoBehaviour
public Sprite[] Symbols;
public AudioClip[] SoundEffects;
private bool partyRedo = false;
private bool cursorLock = false;
private bool noRepeat = true;
@@ -73,6 +75,8 @@ public class GMScript : MonoBehaviour
private ShakeScript shake;
private AudioSource audioPlayer;
enum Colours {
Red, Brown, Orange,
Amber, Yellow, Lime,
@@ -92,6 +96,9 @@ public class GMScript : MonoBehaviour
partyHealth = 8;
level = PlayerPrefs.GetInt("Level");
shake = GameObject.FindGameObjectWithTag("ScreenShake").GetComponent<ShakeScript>();
audioPlayer = this.GetComponent<AudioSource>();
GameObject.FindGameObjectWithTag("Music").GetComponent<MusicScript>().PlayMusic();
if(PlayerPrefs.GetInt("GameMode") == 0 ||
PlayerPrefs.GetInt("GameMode") == 2)
@@ -343,6 +350,9 @@ public class GMScript : MonoBehaviour
if(hit.collider.gameObject.tag == "Party")
{
audioPlayer.PlayOneShot(SoundEffects[0]);
CheckParty(hit.collider.gameObject);
if(noRepeat)
@@ -358,6 +368,8 @@ public class GMScript : MonoBehaviour
if(hit.collider.gameObject.tag == "Attack" && PartyMemberOrder[0] != null)
{
audioPlayer.PlayOneShot(SoundEffects[1]);
cursorLock = true;
StartCoroutine(AttackParty(robotColour));
@@ -429,6 +441,7 @@ public class GMScript : MonoBehaviour
if(hit.collider.gameObject.tag == "Back")
{
audioPlayer.PlayOneShot(SoundEffects[1]);
SceneManager.LoadScene("Mode Select Scene");
}
}
@@ -567,6 +580,8 @@ public class GMScript : MonoBehaviour
Animator attack = PartyMembers[OrderNumbers[i]-1].transform.GetComponent<Animator>();
attack.SetTrigger("AttackTrigger");
audioPlayer.PlayOneShot(SoundEffects[2]);
yield return new WaitForSeconds(
attack.GetCurrentAnimatorStateInfo(0).length
+attack.GetCurrentAnimatorStateInfo(0).normalizedTime);
@@ -674,6 +689,7 @@ public class GMScript : MonoBehaviour
Animator hit = Hit.transform.GetComponent<Animator>();
shake.camShake();
audioPlayer.PlayOneShot(SoundEffects[3]);
yield return new WaitForSeconds(
hit.GetCurrentAnimatorStateInfo(0).length * 2
+hit.GetCurrentAnimatorStateInfo(0).normalizedTime);
@@ -719,6 +735,7 @@ public class GMScript : MonoBehaviour
Animator hit = EnemyHit.transform.GetComponent<Animator>();
yield return new WaitForSeconds(
//DIFFERENT SOUND EFFECT FOR ABILITY MOVES
hit.GetCurrentAnimatorStateInfo(0).length * 2
+hit.GetCurrentAnimatorStateInfo(0).normalizedTime);
@@ -799,6 +816,7 @@ public class GMScript : MonoBehaviour
Animator hit = EnemyHit.transform.GetComponent<Animator>();
shake.camShake();
audioPlayer.PlayOneShot(SoundEffects[3]);
yield return new WaitForSeconds(
hit.GetCurrentAnimatorStateInfo(0).length * 2
+hit.GetCurrentAnimatorStateInfo(0).normalizedTime);
@@ -1048,11 +1066,16 @@ public class GMScript : MonoBehaviour
if((shield || enemyShield) &&
(displayColour != Colours.White
&& displayColour != Colours.Grey
&& displayColour != Colours.Black)) ShieldHit.SetActive(true);
&& displayColour != Colours.Black))
{
audioPlayer.PlayOneShot(SoundEffects[5]);
ShieldHit.SetActive(true);
}
if(weakPointHit)
{
weakPointHit = false;
audioPlayer.PlayOneShot(SoundEffects[4]);
WeakPointHit.SetActive(true);
}
@@ -1064,6 +1087,7 @@ public class GMScript : MonoBehaviour
Animator enemyAttackAnim = EnemyParts[arm].transform.GetComponent<Animator>();
enemyAttackAnim.SetTrigger("AttackTrigger");
audioPlayer.PlayOneShot(SoundEffects[2]);
yield return new WaitForSeconds(
enemyAttackAnim.GetCurrentAnimatorStateInfo(0).length
+enemyAttackAnim.GetCurrentAnimatorStateInfo(0).normalizedTime);
+24
View File
@@ -0,0 +1,24 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MusicScript : MonoBehaviour
{
private AudioSource audioSource;
private void Awake()
{
DontDestroyOnLoad(transform.gameObject);
audioSource = GetComponent<AudioSource>();
}
public void PlayMusic()
{
if (audioSource.isPlaying) return;
audioSource.Play();
}
public void StopMusic()
{
audioSource.Stop();
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3cb1512e426305e4dae6e71a16b738ff
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+2
View File
@@ -35,6 +35,8 @@ public class SelectScript : MonoBehaviour
SideTrimObjectFlip.SetActive(false);
SideTrimObjectFlip.tag = "SideTrim";
GameObject.FindGameObjectWithTag("Music").GetComponent<MusicScript>().StopMusic();
}
// Update is called once per frame