fix: two audioListener fix
This commit is contained in:
parent
2086bb48fb
commit
c4d1fc5f0c
@ -10,6 +10,7 @@ public class Trooper : RobotController
|
|||||||
{
|
{
|
||||||
characterController = GetComponent<CharacterController>();
|
characterController = GetComponent<CharacterController>();
|
||||||
playerInput = GetComponent<PlayerInput>();
|
playerInput = GetComponent<PlayerInput>();
|
||||||
|
audioListener = GetComponentInChildren<AudioListener>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlayerInput Events
|
// PlayerInput Events
|
||||||
@ -37,6 +38,7 @@ public class Trooper : RobotController
|
|||||||
playerInput.enabled = IsOwner;
|
playerInput.enabled = IsOwner;
|
||||||
characterController.enabled = IsOwner;
|
characterController.enabled = IsOwner;
|
||||||
mainCam.enabled = IsOwner;
|
mainCam.enabled = IsOwner;
|
||||||
|
audioListener.enabled = IsOwner;
|
||||||
|
|
||||||
Debug.Log($"NetworkObject ID: {NetworkObjectId} spawned with OwnerClientId: {OwnerClientId}");
|
Debug.Log($"NetworkObject ID: {NetworkObjectId} spawned with OwnerClientId: {OwnerClientId}");
|
||||||
}
|
}
|
||||||
@ -48,6 +50,7 @@ public class Trooper : RobotController
|
|||||||
playerInput.enabled = false;
|
playerInput.enabled = false;
|
||||||
characterController.enabled = false;
|
characterController.enabled = false;
|
||||||
mainCam.enabled = false;
|
mainCam.enabled = false;
|
||||||
|
audioListener.enabled = false;
|
||||||
|
|
||||||
Debug.Log($"NetworkObject ID: {NetworkObjectId} despawned");
|
Debug.Log($"NetworkObject ID: {NetworkObjectId} despawned");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user