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; }