Skip to content

Commit

Permalink
sound fix
Browse files Browse the repository at this point in the history
  • Loading branch information
TSKsmiley committed Apr 24, 2021
1 parent cad3c66 commit 0f2f58f
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 18 deletions.
7 changes: 4 additions & 3 deletions .idea/.idea.RedDead2D/.idea/contentModel.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/.idea.RedDead2D/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 18 additions & 11 deletions Assets/Scenes/Game World.unity
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ MonoBehaviour:
spatialBlend: 0
source: {fileID: 0}
loop: 1
- name: '-----'
- name: -----
clip: {fileID: 0}
volume: 0.16
pitch: 1
Expand Down Expand Up @@ -462,6 +462,13 @@ MonoBehaviour:
spatialBlend: 0
source: {fileID: 0}
loop: 0
- name: walk
clip: {fileID: 8300000, guid: 6fd071f799faa024c99fec59c2781c76, type: 3}
volume: 0.3
pitch: 1
spatialBlend: 0
source: {fileID: 0}
loop: 1
--- !u!4 &7859229
Transform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -3212,7 +3219,7 @@ GameObject:
m_Component:
- component: {fileID: 120438634}
m_Layer: 0
m_Name: '----- Trees --------'
m_Name: ----- Trees --------
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -116259,7 +116266,7 @@ GameObject:
m_Component:
- component: {fileID: 221588026}
m_Layer: 0
m_Name: '----- Rooms -----'
m_Name: ----- Rooms -----
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -117381,7 +117388,7 @@ GameObject:
m_Component:
- component: {fileID: 270767629}
m_Layer: 0
m_Name: '----- Rocks ------'
m_Name: ----- Rocks ------
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -118800,7 +118807,7 @@ GameObject:
m_Component:
- component: {fileID: 352118942}
m_Layer: 0
m_Name: '----WORLD THINGS----'
m_Name: ----WORLD THINGS----
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -254656,7 +254663,7 @@ GameObject:
m_Component:
- component: {fileID: 879038058}
m_Layer: 0
m_Name: '----- Trees --------'
m_Name: ----- Trees --------
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -255918,7 +255925,7 @@ GameObject:
m_Component:
- component: {fileID: 984956568}
m_Layer: 0
m_Name: '----- Buildings -----'
m_Name: ----- Buildings -----
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -583047,7 +583054,7 @@ GameObject:
m_Component:
- component: {fileID: 1360240052}
m_Layer: 0
m_Name: '----- Folliage ------'
m_Name: ----- Folliage ------
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -802085,7 +802092,7 @@ GameObject:
m_Component:
- component: {fileID: 1905429541}
m_Layer: 0
m_Name: '----- Folliage ------'
m_Name: ----- Folliage ------
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -802279,7 +802286,7 @@ GameObject:
m_Component:
- component: {fileID: 1909584739}
m_Layer: 0
m_Name: '----- Rocks ------'
m_Name: ----- Rocks ------
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down Expand Up @@ -802818,7 +802825,7 @@ GameObject:
m_Component:
- component: {fileID: 1935850536}
m_Layer: 0
m_Name: '----- Buildings -----'
m_Name: ----- Buildings -----
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
Expand Down
8 changes: 8 additions & 0 deletions Assets/Scriptable Objects/Quests/05Quest.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/Scriptable Objects/Quests/06Quest.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Assets/Scripts/Audio/AudioManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ public AudioSource GetSound(string name)
{
Sound s = FindSound(name);

return s.source;
return s?.source;
}

public void Play(string name)
{
Sound s = FindSound(name);

s.source.Play();
s?.source.Play();
}

public void Stop(string name) {
Sound s = FindSound(name);

s.source.Stop();
s?.source.Stop();
}

private Sound FindSound(string _name)
Expand All @@ -64,6 +64,7 @@ private Sound FindSound(string _name)
if (s == null)
{
Debug.LogWarning("Sound " + name + " not found");
return null;
}

return s;
Expand Down

0 comments on commit 0f2f58f

Please sign in to comment.