Browse Source

Fixed Music breakage

master
MB 5 years ago
parent
commit
2b9e96d014
4 changed files with 12 additions and 13 deletions
  1. +4
    -1
      Assets/Scipts/CharacterMovement.cs
  2. +1
    -1
      Assets/Scipts/PlayerControllers/LocalPlayer.cs
  3. +7
    -3
      Assets/Scipts/SoundManager.cs
  4. +0
    -8
      Assets/WorldAssets.meta

+ 4
- 1
Assets/Scipts/CharacterMovement.cs View File

@ -66,7 +66,10 @@ public class CharacterMovement : MonoBehaviour {
public void Greet()
{
Cheer.Play();
if (Cheer != null)
{
Cheer.Play();
}
//Trigger animation
}
}

+ 1
- 1
Assets/Scipts/PlayerControllers/LocalPlayer.cs View File

@ -52,7 +52,7 @@ public class LocalPlayer : Player {
}
Animator.SetFloat("WalkSpeed", animWalkSpeed);
if (WalkingSounds.isPlaying != true)
if ( WalkingSounds != null && WalkingSounds.isPlaying != true)
{
WalkingSounds.Play();
}

+ 7
- 3
Assets/Scipts/SoundManager.cs View File

@ -12,9 +12,13 @@ public class SoundManager : MonoBehaviour {
AudioSource curMusic;
public void Start()
{
Startmusic.Play();
StartCoroutine(ChangeMusic(loopMusic, Startmusic.clip.length));
StartCoroutine(ChangeMusic(loopMusic, gameLength - 10.0f));
if (Startmusic != null)
{
curMusic = Startmusic;
Startmusic.Play();
StartCoroutine(ChangeMusic(loopMusic, Startmusic.clip.length));
StartCoroutine(ChangeMusic(loopMusic, gameLength - 10.0f));
}
}
private void Update()

+ 0
- 8
Assets/WorldAssets.meta View File

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 7da0e8d0a6415f944aa43dff57b38ae3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Loading…
Cancel
Save