This commit is contained in:
Morgan - 6 Freedom 2024-01-28 03:06:32 +01:00
commit 7a0d03544f
4 changed files with 34 additions and 7 deletions

BIN
Assets/Audio SFX/incorrect-buzzer-sound-147336.mp3 (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 6a8e3f6dace40f549802ccbfb7b9cb4e
AudioImporter:
externalObjects: {}
serializedVersion: 7
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@ -10,6 +10,7 @@ public class CameraManager : MonoBehaviour
public Button resumeButton; public Button resumeButton;
public RawImage photoBox; public RawImage photoBox;
private Texture2D photo; private Texture2D photo;
private int numberOfWebcams;
// Start is called before the first frame update // Start is called before the first frame update
void OnEnable() void OnEnable()
@ -26,6 +27,7 @@ void OnDisable()
void Start() void Start()
{ {
wDevice = WebCamTexture.devices.FirstOrDefault(x => x.isFrontFacing == false); wDevice = WebCamTexture.devices.FirstOrDefault(x => x.isFrontFacing == false);
numberOfWebcams = WebCamTexture.devices.Count();
} }
// Update is called once per frame // Update is called once per frame
@ -126,7 +128,7 @@ public Texture2D GetPhoto()
return photo; return photo;
} }
if (!wTexture || WebCamTexture.devices.Count() < 1) if (!wTexture || numberOfWebcams < 1)
{ {
return null; return null;
} }

View File

@ -321,11 +321,10 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e)
} }
case (int)GameState.WaitingForOtherPlayersToJoin: case (int)GameState.WaitingForOtherPlayersToJoin:
{ {
if (!HomeConnection.activeInHierarchy)
{
CheckIfIAmTheFirst(myRoom.GetPlayerList()); CheckIfIAmTheFirst(myRoom.GetPlayerList());
UpdateDisplayedListUser(myRoom.GetPlayerList()); UpdateDisplayedListUser(myRoom.GetPlayerList());
}
break; break;
} }
case (int)GameState.Explanation: case (int)GameState.Explanation:
@ -336,7 +335,7 @@ private void OnRoomUpdate(object sender, ValueChangedEventArgs e)
} }
WaitingRoom.SetActive(false); WaitingRoom.SetActive(false);
BeforeStart.SetActive(true); BeforeStart.SetActive(true);
endOfExplanationDate = DateTime.Now.AddSeconds(3); endOfExplanationDate = DateTime.Now.AddSeconds(4);
break; break;
} }