diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 27820e1..e79e370 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -6,6 +6,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using TMPro; +using Unity.VisualScripting; using UnityEngine; /// @@ -489,6 +490,17 @@ public void onClickNewPlayers() } }); } + + + public void OnClickProposition(int propositionNumber) + { + int currentQuestionId = Int32.Parse(myRoom.currentQuestionId); + List voters = myRoom.questions[currentQuestionId].propositions[propositionNumber].voters.ToList(); + voters.Add(currentPlayer.id); + myOnlineRoom.Child("questions").Child(myRoom.currentQuestionId.ToString()).Child("propositions").Child(propositionNumber.ToString()).Child("voters").SetValueAsync(voters); + } + + } public enum GameState