Skip to content

Commit

Permalink
fix:Small fix to audio listeners (#20)
Browse files Browse the repository at this point in the history
Co-authored-by: Cosmin <38663153+Cosmin-B@users.noreply.github.com>
  • Loading branch information
LukeStampfli and Cosmin-B committed Jul 22, 2021
1 parent 85ad881 commit 3dc3c39
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
9 changes: 9 additions & 0 deletions Basic/2DSpaceShooter/Assets/Prefabs/Ship.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ GameObject:
- component: {fileID: 8200002}
- component: {fileID: 509584576524893815}
- component: {fileID: -1137344530773526120}
- component: {fileID: 7678745961864154063}
m_Layer: 0
m_Name: Ship
m_TagString: Untagged
Expand Down Expand Up @@ -420,6 +421,14 @@ MonoBehaviour:
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!81 &7678745961864154063
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 100000}
m_Enabled: 0
--- !u!1 &100002
GameObject:
m_ObjectHideFlags: 0
Expand Down
9 changes: 0 additions & 9 deletions Basic/2DSpaceShooter/Assets/Scenes/network.unity
Original file line number Diff line number Diff line change
Expand Up @@ -1093,22 +1093,13 @@ GameObject:
- component: {fileID: 1667533374}
- component: {fileID: 1667533373}
- component: {fileID: 1667533371}
- component: {fileID: 1667533370}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &1667533370
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1667533368}
m_Enabled: 1
--- !u!124 &1667533371
Behaviour:
m_ObjectHideFlags: 0
Expand Down
2 changes: 1 addition & 1 deletion Basic/2DSpaceShooter/Assets/Scripts/ShipControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ void Start()

public override void NetworkStart()
{
GetComponent<AudioListener>().enabled = true;
GetComponent<AudioListener>().enabled = IsOwner;
}

public void TakeDamage(int amount)
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- Removed empty MonoBehaviours which were used as tags and using the Unity tag system instead.
- Removed the dependency to the community contributions repository and copied `NetworkManagerHud` and `NetworkObjectPool` into the sample.
- Small QoL improvements to scripting. Using `TryGetComponent` and `CompareTag`.
- Fix audio issues by moving the audio listener onto the player ship object.

#### Known Issues

Expand Down

0 comments on commit 3dc3c39

Please sign in to comment.