2024-01-08 22:03:29 +01:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
2024-01-10 17:14:23 +01:00
|
|
|
using TMPro;
|
|
|
|
|
|
|
|
[System.Serializable]
|
|
|
|
public class Question
|
|
|
|
{
|
|
|
|
public string question;
|
|
|
|
public string[] answers;
|
|
|
|
public int good_answer;
|
|
|
|
public int type;
|
|
|
|
}
|
|
|
|
|
|
|
|
[System.Serializable]
|
|
|
|
public class Questions
|
|
|
|
{
|
|
|
|
public Question[] questions;
|
|
|
|
}
|
2024-01-08 22:03:29 +01:00
|
|
|
|
|
|
|
public class QuizzManager : MonoBehaviour
|
|
|
|
{
|
2024-02-02 09:14:28 +01:00
|
|
|
public GameObject LauncherScreen;
|
|
|
|
public GameObject GameScreen;
|
|
|
|
public GameObject Question1;
|
|
|
|
public GameObject Question2;
|
|
|
|
public GameObject Question3;
|
|
|
|
|
|
|
|
void Start()
|
|
|
|
{
|
|
|
|
LauncherScreen.GetComponent<Canvas>().enabled = true;
|
|
|
|
GameScreen.GetComponent<Canvas>().enabled = false;
|
|
|
|
Question1.GetComponent<Canvas>().enabled = true;
|
|
|
|
Question2.GetComponent<Canvas>().enabled = false;
|
|
|
|
Question3.GetComponent<Canvas>().enabled = false;
|
2024-01-08 22:03:29 +01:00
|
|
|
}
|
|
|
|
|
2024-02-02 09:14:28 +01:00
|
|
|
public void LaunchGame() {
|
|
|
|
LauncherScreen.GetComponent<Canvas>().enabled = false;
|
|
|
|
GameScreen.GetComponent<Canvas>().enabled = true;
|
2024-01-10 17:14:23 +01:00
|
|
|
}
|
|
|
|
|
2024-02-02 09:14:28 +01:00
|
|
|
public void LeaveQuizz() {
|
|
|
|
|
2024-01-10 17:14:23 +01:00
|
|
|
}
|
|
|
|
|
2024-02-02 09:14:28 +01:00
|
|
|
public void ToQuestion2() {
|
|
|
|
Question1.GetComponent<Canvas>().enabled = false;
|
|
|
|
Question2.GetComponent<Canvas>().enabled = true;
|
2024-01-10 17:14:23 +01:00
|
|
|
}
|
|
|
|
|
2024-02-02 09:14:28 +01:00
|
|
|
public void ToQuestion3() {
|
|
|
|
Question2.GetComponent<Canvas>().enabled = false;
|
|
|
|
Question3.GetComponent<Canvas>().enabled = true;
|
2024-01-10 17:14:23 +01:00
|
|
|
}
|
|
|
|
|
2024-02-02 09:14:28 +01:00
|
|
|
public void ToHome() {
|
|
|
|
LauncherScreen.GetComponent<Canvas>().enabled = true;
|
|
|
|
GameScreen.GetComponent<Canvas>().enabled = false;
|
2024-01-08 22:03:29 +01:00
|
|
|
}
|
|
|
|
}
|