Compare commits
6 Commits
c779e6348b
...
8a4a3ef814
Author | SHA1 | Date | |
---|---|---|---|
8a4a3ef814 | |||
8a3b3d6c98 | |||
bddd04413e | |||
71f04dc4d5 | |||
48d607dfdf | |||
3217569320 |
39
Assets/Scripts/Quizz/LoadingManager.cs
Normal file
39
Assets/Scripts/Quizz/LoadingManager.cs
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class LoadingManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
public GameObject LoadingScreen;
|
||||||
|
public GameObject TutorialScreen;
|
||||||
|
public GameObject GameScreen;
|
||||||
|
|
||||||
|
private bool launched = false;
|
||||||
|
private bool game = false;
|
||||||
|
|
||||||
|
void Start() {
|
||||||
|
LoadingScreen.GetComponent<Canvas>().enabled = true;
|
||||||
|
TutorialScreen.GetComponent<Canvas>().enabled = false;
|
||||||
|
GameScreen.GetComponent<Canvas>().enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LaunchTutorial() {
|
||||||
|
if (!launched) {
|
||||||
|
LoadingScreen.GetComponent<Canvas>().enabled = false;
|
||||||
|
TutorialScreen.GetComponent<Canvas>().enabled = true;
|
||||||
|
launched = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LaunchGame() {
|
||||||
|
if (!game) {
|
||||||
|
TutorialScreen.GetComponent<Canvas>().enabled = false;
|
||||||
|
GameScreen.GetComponent<Canvas>().enabled = true;
|
||||||
|
game = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LeaveApp() {
|
||||||
|
Application.Quit();
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Scripts/Quizz/LoadingManager.cs.meta
Normal file
11
Assets/Scripts/Quizz/LoadingManager.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1ce983d8b15e46d4491e43d7c8ed2568
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
90
Assets/Scripts/Quizz/OLD.cs
Normal file
90
Assets/Scripts/Quizz/OLD.cs
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
using TMPro;
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public class aQuestion
|
||||||
|
{
|
||||||
|
public string aquestion;
|
||||||
|
public string[] answers;
|
||||||
|
public int good_answer;
|
||||||
|
public int type;
|
||||||
|
}
|
||||||
|
|
||||||
|
[System.Serializable]
|
||||||
|
public class aQuestions
|
||||||
|
{
|
||||||
|
public aQuestion[] aquestions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public class QsuizzManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
public GameObject LoadingCanvas;
|
||||||
|
public GameObject TutorialCanvas;
|
||||||
|
public GameObject aQuestions;
|
||||||
|
public GameObject Home;
|
||||||
|
public TextAsset jsonFile;
|
||||||
|
private bool launched;
|
||||||
|
private bool started;
|
||||||
|
private int answer_button;
|
||||||
|
|
||||||
|
void Start() {
|
||||||
|
LoadingCanvas.GetComponent<Canvas>().enabled = true;
|
||||||
|
TutorialCanvas.GetComponent<Canvas>().enabled = false;
|
||||||
|
aQuestions.GetComponent<Canvas>().enabled = false;
|
||||||
|
Home.GetComponent<Canvas>().enabled = false;
|
||||||
|
launched = false;
|
||||||
|
started = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void ShowTutorial() {
|
||||||
|
if (!launched) {
|
||||||
|
LoadingCanvas.GetComponent<Canvas>().enabled = false;
|
||||||
|
TutorialCanvas.GetComponent<Canvas>().enabled = true;
|
||||||
|
launched = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LaunchQuizz() {
|
||||||
|
if (!started) {
|
||||||
|
TutorialCanvas.GetComponent<Canvas>().enabled = false;
|
||||||
|
Home.GetComponent<Canvas>().enabled = true;
|
||||||
|
started = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LeaveApp() {
|
||||||
|
Application.Quit();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void YesNoaQuestion(aQuestion aquestion) {
|
||||||
|
GameObject.Find("aQuestion").GetComponent<TMP_Text>().text = aquestion.aquestion;
|
||||||
|
GameObject.Find("AnswerA").GetComponentInChildren<TMP_Text>().text = aquestion.answers[0];
|
||||||
|
GameObject.Find("AnswerB").GetComponentInChildren<TMP_Text>().text = aquestion.answers[1];
|
||||||
|
GameObject.Find("HidingCanva").GetComponent<Canvas>().enabled = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ClassicaQuestion(aQuestion aquestion) {
|
||||||
|
GameObject.Find("aQuestion").GetComponent<TMP_Text>().text = aquestion.aquestion;
|
||||||
|
GameObject.Find("HidingCanva").GetComponent<Canvas>().enabled = true;
|
||||||
|
GameObject.Find("AnswerA").GetComponentInChildren<TMP_Text>().text = aquestion.answers[0];
|
||||||
|
GameObject.Find("AnswerB").GetComponentInChildren<TMP_Text>().text = aquestion.answers[1];
|
||||||
|
GameObject.Find("AnswerC").GetComponentInChildren<TMP_Text>().text = aquestion.answers[2];
|
||||||
|
GameObject.Find("AnswerD").GetComponentInChildren<TMP_Text>().text = aquestion.answers[3];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StartQuizz() {
|
||||||
|
Home.GetComponent<Canvas>().enabled = false;
|
||||||
|
aQuestions.GetComponent<Canvas>().enabled = true;
|
||||||
|
aQuestions aquestions = JsonUtility.FromJson<aQuestions>(jsonFile.text);
|
||||||
|
for (int i = 0; i < aquestions.aquestions.Length; i++) {
|
||||||
|
aQuestion aquestion = aquestions.aquestions[i];
|
||||||
|
if (aquestion.type == 0) {
|
||||||
|
ClassicaQuestion(aquestion);
|
||||||
|
} else {
|
||||||
|
YesNoaQuestion(aquestion);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
11
Assets/Scripts/Quizz/OLD.cs.meta
Normal file
11
Assets/Scripts/Quizz/OLD.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b4092beca5e50a24d9c6771c5e5eef64
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -20,71 +20,42 @@ public class Questions
|
|||||||
|
|
||||||
public class QuizzManager : MonoBehaviour
|
public class QuizzManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
public GameObject LoadingCanvas;
|
public GameObject LauncherScreen;
|
||||||
public GameObject TutorialCanvas;
|
public GameObject GameScreen;
|
||||||
public GameObject Questions;
|
public GameObject Question1;
|
||||||
public GameObject Home;
|
public GameObject Question2;
|
||||||
public TextAsset jsonFile;
|
public GameObject Question3;
|
||||||
private bool launched;
|
|
||||||
private bool started;
|
|
||||||
private int answer_button;
|
|
||||||
|
|
||||||
void Start() {
|
void Start()
|
||||||
LoadingCanvas.GetComponent<Canvas>().enabled = true;
|
{
|
||||||
TutorialCanvas.GetComponent<Canvas>().enabled = false;
|
LauncherScreen.GetComponent<Canvas>().enabled = true;
|
||||||
Questions.GetComponent<Canvas>().enabled = false;
|
GameScreen.GetComponent<Canvas>().enabled = false;
|
||||||
Home.GetComponent<Canvas>().enabled = false;
|
Question1.GetComponent<Canvas>().enabled = true;
|
||||||
launched = false;
|
Question2.GetComponent<Canvas>().enabled = false;
|
||||||
started = false;
|
Question3.GetComponent<Canvas>().enabled = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ShowTutorial() {
|
public void LaunchGame() {
|
||||||
if (!launched) {
|
LauncherScreen.GetComponent<Canvas>().enabled = false;
|
||||||
LoadingCanvas.GetComponent<Canvas>().enabled = false;
|
GameScreen.GetComponent<Canvas>().enabled = true;
|
||||||
TutorialCanvas.GetComponent<Canvas>().enabled = true;
|
|
||||||
launched = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LaunchQuizz() {
|
public void LeaveQuizz() {
|
||||||
if (!started) {
|
|
||||||
TutorialCanvas.GetComponent<Canvas>().enabled = false;
|
|
||||||
Home.GetComponent<Canvas>().enabled = true;
|
|
||||||
started = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LeaveApp() {
|
public void ToQuestion2() {
|
||||||
Application.Quit();
|
Question1.GetComponent<Canvas>().enabled = false;
|
||||||
|
Question2.GetComponent<Canvas>().enabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void YesNoQuestion(Question question) {
|
public void ToQuestion3() {
|
||||||
GameObject.Find("Question").GetComponent<TMP_Text>().text = question.question;
|
Question2.GetComponent<Canvas>().enabled = false;
|
||||||
GameObject.Find("AnswerA").GetComponentInChildren<TMP_Text>().text = question.answers[0];
|
Question3.GetComponent<Canvas>().enabled = true;
|
||||||
GameObject.Find("AnswerB").GetComponentInChildren<TMP_Text>().text = question.answers[1];
|
|
||||||
GameObject.Find("HidingCanva").GetComponent<Canvas>().enabled = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ClassicQuestion(Question question) {
|
public void ToHome() {
|
||||||
GameObject.Find("Question").GetComponent<TMP_Text>().text = question.question;
|
LauncherScreen.GetComponent<Canvas>().enabled = true;
|
||||||
GameObject.Find("HidingCanva").GetComponent<Canvas>().enabled = true;
|
GameScreen.GetComponent<Canvas>().enabled = false;
|
||||||
GameObject.Find("AnswerA").GetComponentInChildren<TMP_Text>().text = question.answers[0];
|
|
||||||
GameObject.Find("AnswerB").GetComponentInChildren<TMP_Text>().text = question.answers[1];
|
|
||||||
GameObject.Find("AnswerC").GetComponentInChildren<TMP_Text>().text = question.answers[2];
|
|
||||||
GameObject.Find("AnswerD").GetComponentInChildren<TMP_Text>().text = question.answers[3];
|
|
||||||
}
|
|
||||||
|
|
||||||
public void StartQuizz() {
|
|
||||||
Home.GetComponent<Canvas>().enabled = false;
|
|
||||||
Questions.GetComponent<Canvas>().enabled = true;
|
|
||||||
Questions questions = JsonUtility.FromJson<Questions>(jsonFile.text);
|
|
||||||
for (int i = 0; i < questions.questions.Length; i++) {
|
|
||||||
Question question = questions.questions[i];
|
|
||||||
if (question.type == 0) {
|
|
||||||
ClassicQuestion(question);
|
|
||||||
} else {
|
|
||||||
YesNoQuestion(question);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
8
Assets/TextMesh Pro/Documentation.meta
Normal file
8
Assets/TextMesh Pro/Documentation.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 8e7e8f5a82a3a134e91c54efd2274ea9
|
||||||
|
folderAsset: yes
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
BIN
Assets/TextMesh Pro/Documentation/TextMesh Pro User Guide 2016.pdf
(Stored with Git LFS)
Normal file
BIN
Assets/TextMesh Pro/Documentation/TextMesh Pro User Guide 2016.pdf
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 1b8d251f9af63b746bf2f7ffe00ebb9b
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
File diff suppressed because it is too large
Load Diff
3802
Assets/__Scenes/tmp.unity
Normal file
3802
Assets/__Scenes/tmp.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
Assets/__Scenes/tmp.unity.meta
Normal file
7
Assets/__Scenes/tmp.unity.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 2c5db3808697d5d42bef016039ab3370
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -15,6 +15,13 @@
|
|||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"url": "https://packages.unity.com"
|
"url": "https://packages.unity.com"
|
||||||
},
|
},
|
||||||
|
"com.unity.device-simulator.devices": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"depth": 0,
|
||||||
|
"source": "registry",
|
||||||
|
"dependencies": {},
|
||||||
|
"url": "https://packages.unity.com"
|
||||||
|
},
|
||||||
"com.unity.editorcoroutines": {
|
"com.unity.editorcoroutines": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"depth": 1,
|
"depth": 1,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user