test: debug
This commit is contained in:
parent
8902795ecd
commit
44a0a3fb39
@ -10,22 +10,26 @@ public class QuestionHandler : MonoBehaviour
|
||||
public TextMeshProUGUI explainText;
|
||||
public PromptList promptList;
|
||||
private List<Question> 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<CameraManager>();
|
||||
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user