fix:Small fix to audio listeners (#20)

Co-authored-by: Cosmin <38663153+Cosmin-B@users.noreply.github.com>
This commit is contained in:
Luke Stampfli 2021-07-22 10:29:02 +01:00 коммит произвёл GitHub
Родитель 85ad881a81
Коммит 3dc3c39f8a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 11 добавлений и 10 удалений

Просмотреть файл

@ -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
@ -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

Просмотреть файл

@ -1093,7 +1093,6 @@ GameObject:
- component: {fileID: 1667533374}
- component: {fileID: 1667533373}
- component: {fileID: 1667533371}
- component: {fileID: 1667533370}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
@ -1101,14 +1100,6 @@ GameObject:
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

Просмотреть файл

@ -107,7 +107,7 @@ public class ShipControl : NetworkBehaviour
public override void NetworkStart()
{
GetComponent<AudioListener>().enabled = true;
GetComponent<AudioListener>().enabled = IsOwner;
}
public void TakeDamage(int amount)

Просмотреть файл

@ -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