From 44a0a3fb39328265528157cba92d4ebd468308aa Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Sun, 28 Jan 2024 16:19:30 +0100 Subject: [PATCH] test: debug --- Assets/Scripts/QuestionHandler.cs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Assets/Scripts/QuestionHandler.cs b/Assets/Scripts/QuestionHandler.cs index 5a389bc..a273b39 100644 --- a/Assets/Scripts/QuestionHandler.cs +++ b/Assets/Scripts/QuestionHandler.cs @@ -10,22 +10,26 @@ public class QuestionHandler : MonoBehaviour public TextMeshProUGUI explainText; public PromptList promptList; private List player2questions; - private int currentQuestion = 0; + private int currentQuestion = 1; void OnEnable() { player2questions = gameManager.myRoom.GetQuestionsByPlayer(gameManager.currentPlayer); - Redraw(++currentQuestion); + Debug.Log(currentQuestion); + Debug.Log(JsonUtility.ToJson(player2questions)); + Redraw(currentQuestion); } void OnDisable() { player2questions = null; + currentQuestion = 1; } void Redraw(int currentQuestion) { Prompt prompt = promptList.prompts.Find(x => x.id == player2questions[currentQuestion - 1].promptId); + Debug.Log(JsonUtility.ToJson(prompt)); explainText.SetText(prompt.en); CameraManager cameraManager = gameObject.GetComponent(); @@ -47,7 +51,8 @@ public void OnSubmitButton() GetPropRef(gameManager.currentPlayer)); if (currentQuestion < 2) { - Redraw(++currentQuestion); + currentQuestion++; + Redraw(currentQuestion); } else { gameManager.myRoom.currentState = (int) GameState.PropositionsSent; }