fix(vote): questionID was converted to Quesiton object

This commit is contained in:
Fangh 2024-01-28 22:57:43 +01:00
parent c09b3fb8f0
commit f01d2e4227

View File

@ -6,6 +6,7 @@
using Firebase.Extensions; using Firebase.Extensions;
using Newtonsoft.Json; using Newtonsoft.Json;
using TMPro; using TMPro;
using Unity.VisualScripting;
using UnityEngine; using UnityEngine;
using UnityEngine.UI; using UnityEngine.UI;
@ -509,7 +510,7 @@ public void onClickNewPlayers()
private void OnCurrentQuestionChanged(object sender, ValueChangedEventArgs onlineValue) private void OnCurrentQuestionChanged(object sender, ValueChangedEventArgs onlineValue)
{ {
Question q = JsonConvert.DeserializeObject<Question>(onlineValue.Snapshot.GetRawJsonValue()); Question q = myRoom.questions[onlineValue.Snapshot.Value.ConvertTo<int>()];
if (WaitingOtherPlayers.activeInHierarchy) if (WaitingOtherPlayers.activeInHierarchy)
{ {