15 Commits

Author SHA1 Message Date
8a4a3ef814 Merge branch 'feature/quizz' into develop 2024-02-04 16:02:52 +01:00
8a3b3d6c98 QUIZZ: Resolving merge 2024-02-04 16:02:08 +01:00
bddd04413e Merge pull request 'update README.md' (#14) from develop into main
Reviewed-on: #14
2024-02-02 16:56:43 +01:00
71f04dc4d5 Merge pull request 'develop' (#12) from develop into main
Reviewed-on: #12
2024-02-02 16:43:28 +01:00
7084fcaa30 Merge pull request 'Prise en compte du module factory pour créer et afficher des gameobjects dynamiquement' (#11) from feature/molecule into develop
Reviewed-on: #11
Reviewed-by: Clement <clement@jo85.com>
2024-02-02 16:43:00 +01:00
48d607dfdf Quizz: Re-arranging scenes 2024-02-02 16:00:50 +01:00
c779e6348b update README.md 2024-02-02 15:54:57 +01:00
a642cc0a38 ajout de l'atom factory 2024-02-02 15:29:49 +01:00
91e3d2e28a Merge pull request 'feature/AtomesFactory' (#13) from feature/AtomesFactory into develop
Reviewed-on: #13
Reviewed-by: Nicolas <nicolas.sansd@gmail.com>
2024-02-02 15:03:43 +01:00
9c5f5b15fb Merge remote-tracking branch 'origin/develop' into feature/molecule
# Conflicts:
#	Assets/script/AtomeFactory.cs
2024-02-02 14:09:36 +01:00
27ce4e14a8 Merge remote-tracking branch 'origin/develop' into feature/AtomesFactory 2024-02-02 14:02:05 +01:00
9b7b156d7b add 3D atome 2024-02-02 14:33:35 +01:00
3217569320 QUIZZ: Adding quizz 2024-02-02 09:14:28 +01:00
f7a2cc4c88 Add factory for animated Atome 2024-01-26 12:03:56 +01:00
f4be67ca29 Création du prefab et script de l'atom + ajout du lock mode 2024-01-19 10:07:10 +01:00
60 changed files with 10446 additions and 2588 deletions

View File

@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TMPro;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.UI;
@ -26,6 +28,7 @@ public class ActiveScoppedElements : MonoBehaviour
public TextAsset atomJsonFile;
public HashSet<String> actives = new HashSet<String>();
public HashSet<GameObject> InstantiatesObject = new HashSet<GameObject>();
public HashSet<GameObject> AtomInstantiatesObjects = new HashSet<GameObject>();
public TextMeshProUGUI textToUpdate;
public TextMeshProUGUI objectInstantiateText;
public HashSet<GameObject> DisableGameObjects = new HashSet<GameObject>();
@ -33,6 +36,8 @@ public class ActiveScoppedElements : MonoBehaviour
public GameObject[] DebugObjs;
private AnimationState _animationState = AnimationState.IDLE;
private float _animationSpeed = 1.0f;
public GameObject atomPrefabToInstantiate;
private bool IsLock = false;
private AtomeFactory _atomFactory;
@ -58,7 +63,7 @@ public class ActiveScoppedElements : MonoBehaviour
{
actives.Add(name);
RefreshText();
RefreshAtom();
RefreshAtom(name, true);
}
}
@ -128,6 +133,11 @@ public class ActiveScoppedElements : MonoBehaviour
this._animationSpeed -= 0.5f;
}
public void onClickToggleLockMode()
{
this.IsLock = !this.IsLock;
}
void Update()
{
if (this._animationState == AnimationState.GORIGHT)
@ -222,8 +232,65 @@ public class ActiveScoppedElements : MonoBehaviour
}
return null;
}
private void RenderAtom(String elementName, bool toAdd)
{
var cleanedElement = CleanStringOfDigits(elementName);
if (!toAdd)
{
try
{
var a = AtomInstantiatesObjects.First(t => t.name == ("ATOM_" + cleanedElement));
if (a != null)
{
AtomInstantiatesObjects.Remove(a);
Destroy(a);
Debug.Log("AtomInstantiatesObjects.Remove(a) called !");
return;
}
}
catch (Exception ex)
{
Debug.Log("pas trouvé");
return;
}
}
var atomObject = GameObject.Find(elementName);
if (atomObject == null) {
Debug.Log("atomObject=null");
return;
}
if (atomObject.transform.childCount >= 1) {
//atomObject.transform.GetChild(0).GetComponent<GameObject>().SetActive(true);
Debug.Log("Object already created !");
return;
}
var factory = MoleculeFactory.getInstrance(this.jsonFile);
factory.setAtomFactory(this._atomFactory);
if (!factory.GetAtomFactory().hasAtome(cleanedElement))
{
Debug.Log("No atom found with this formula '" + cleanedElement + "'");
return;
}
var obj = this._atomFactory.createAnimatedAtome(cleanedElement);
obj.name = "ATOM_" + cleanedElement;
obj.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);
Quaternion cameraRotation = Quaternion.Euler(0, Camera.main.transform.rotation.eulerAngles.y, 0);
obj.transform.localPosition = new Vector3(0, 0, 0);
obj.transform.SetParent(atomObject.transform, false);
obj.transform.rotation = cameraRotation;
AtomInstantiatesObjects.Add(obj);
//var obj = Instantiate(atomPrefabToInstantiate, new Vector3(0, 0, 0), Quaternion.identity);
//AtomPrefab objPrefab = obj.GetComponent<AtomPrefab>();
//AtomeInformation info = factory.GetAtomFactory().createAtome(cleanedElement);
//objPrefab.Render(info);
}
private void RefreshAtom()
private void RefreshAtom(String elementName, bool toAdd)
{
var objToFind = FindGameObjectWithFormula();
if (objToFind != null)
@ -233,6 +300,13 @@ public class ActiveScoppedElements : MonoBehaviour
{
throw new Exception("NO MAIN CAMERA DEFINED ");
}
foreach (var atomInstantiatesObject in AtomInstantiatesObjects)
{
Destroy(atomInstantiatesObject);
}
AtomInstantiatesObjects.Clear();
Vector3 cameraPosition = Camera.main.transform.position;
Quaternion cameraRotation = Quaternion.Euler(0, Camera.main.transform.rotation.eulerAngles.y, 0);
Vector3 position = cameraPosition + cameraRotation * Vector3.forward * 0.35f;
@ -263,6 +337,7 @@ public class ActiveScoppedElements : MonoBehaviour
}
InstantiatesObject.Clear();
EnableAllMarkerModel();
RenderAtom(elementName, toAdd);
}
if (InstantiatesObject.Count > 0 && objectInstantiateText != null) {
@ -314,12 +389,36 @@ public class ActiveScoppedElements : MonoBehaviour
debugObj.SetActive(true);
}
}
private string CleanStringOfNonDigits( string s )
{
if (string.IsNullOrEmpty(s)) return s;
StringBuilder sb = new StringBuilder(s.Length) ;
for (int i = 0; i < s.Length; ++i)
{
char c = s[i];
if ( c < '0' ) continue ;
if ( c > '9' ) continue ;
sb.Append(s[i]);
}
string cleaned = sb.ToString();
return cleaned;
}
private string CleanStringOfDigits(string s)
{
return new String(s.Where(Char.IsLetter).ToArray());
}
public void RemoveUnscoppedElement(String elementName)
{
if (this.IsLock)
{
return;
}
Debug.Log("Removed " + elementName);
actives.Remove(elementName);
RefreshText();
RefreshAtom();
RefreshAtom(elementName, false);
}
}

24
Assets/AtomPrefab.cs Normal file
View File

@ -0,0 +1,24 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AtomPrefab : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
public void Render(AtomeInformation info)
{
Debug.Log("Render from AtomPrefab !");
Debug.Log("+" + info.name);
}
// Update is called once per frame
void Update()
{
}
}

11
Assets/AtomPrefab.cs.meta Normal file
View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 47ead1cb7daeaeb4b95eb0a250ab16e2
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

46
Assets/AtomPrefab.prefab Normal file
View File

@ -0,0 +1,46 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4409383611147121166
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 8219824475726194073}
- component: {fileID: -3269112147395156294}
m_Layer: 0
m_Name: AtomPrefab
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &8219824475726194073
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4409383611147121166}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &-3269112147395156294
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4409383611147121166}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 47ead1cb7daeaeb4b95eb0a250ab16e2, type: 3}
m_Name:
m_EditorClassIdentifier:

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: d9d5dcbc28f5ad041b1b60b004ccf890
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 28b9d8dbb107495ca4f8eee7c58c8331
guid: 37af6d74498845929dd6e83207cb290b
TextureImporter:
internalIDToNameTable: []
externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: bef4d72022e54ca79ed956f8c53ba384
guid: e9c72328fc874d839109b14cf10682b3
TextureImporter:
internalIDToNameTable: []
externalObjects: {}

Binary file not shown.

View File

@ -0,0 +1,179 @@
fileFormatVersion: 2
guid: a0ad14f92cb7404986a81b94582472d0
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 1
swizzle: 50462976
cookieLightType: 2
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: iPhone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Lumin
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Windows Store Apps
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 1203a963a0b24da48a481e62246ee716
guid: 79885e89e6674ad491bbbf9042a3ff9f
TextureImporter:
internalIDToNameTable: []
externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 39977f35879443cb8977b0765c069367
guid: 3c04e0e5c1c64aa9b6e290b3b324bc83
TextureImporter:
internalIDToNameTable: []
externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 79979c2c9e3149a3aa74c3f3b1581859
guid: 008ede79072843598b9e0fe69288cc10
TextureImporter:
internalIDToNameTable: []
externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 173366883292404a8fb0129994277f47
guid: fd028b6367dc453dbd4bde749074ca75
TextureImporter:
internalIDToNameTable: []
externalObjects: {}

View 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();
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1ce983d8b15e46d4491e43d7c8ed2568
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

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

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: b4092beca5e50a24d9c6771c5e5eef64
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -20,71 +20,42 @@ public class Questions
public class QuizzManager : MonoBehaviour
{
public GameObject LoadingCanvas;
public GameObject TutorialCanvas;
public GameObject Questions;
public GameObject Home;
public TextAsset jsonFile;
private bool launched;
private bool started;
private int answer_button;
public GameObject LauncherScreen;
public GameObject GameScreen;
public GameObject Question1;
public GameObject Question2;
public GameObject Question3;
void Start() {
LoadingCanvas.GetComponent<Canvas>().enabled = true;
TutorialCanvas.GetComponent<Canvas>().enabled = false;
Questions.GetComponent<Canvas>().enabled = false;
Home.GetComponent<Canvas>().enabled = false;
launched = false;
started = false;
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;
}
public void ShowTutorial() {
if (!launched) {
LoadingCanvas.GetComponent<Canvas>().enabled = false;
TutorialCanvas.GetComponent<Canvas>().enabled = true;
launched = true;
}
public void LaunchGame() {
LauncherScreen.GetComponent<Canvas>().enabled = false;
GameScreen.GetComponent<Canvas>().enabled = true;
}
public void LaunchQuizz() {
if (!started) {
TutorialCanvas.GetComponent<Canvas>().enabled = false;
Home.GetComponent<Canvas>().enabled = true;
started = true;
}
public void LeaveQuizz() {
}
public void LeaveApp() {
Application.Quit();
public void ToQuestion2() {
Question1.GetComponent<Canvas>().enabled = false;
Question2.GetComponent<Canvas>().enabled = true;
}
private void YesNoQuestion(Question question) {
GameObject.Find("Question").GetComponent<TMP_Text>().text = question.question;
GameObject.Find("AnswerA").GetComponentInChildren<TMP_Text>().text = question.answers[0];
GameObject.Find("AnswerB").GetComponentInChildren<TMP_Text>().text = question.answers[1];
GameObject.Find("HidingCanva").GetComponent<Canvas>().enabled = false;
public void ToQuestion3() {
Question2.GetComponent<Canvas>().enabled = false;
Question3.GetComponent<Canvas>().enabled = true;
}
private void ClassicQuestion(Question question) {
GameObject.Find("Question").GetComponent<TMP_Text>().text = question.question;
GameObject.Find("HidingCanva").GetComponent<Canvas>().enabled = true;
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);
}
}
public void ToHome() {
LauncherScreen.GetComponent<Canvas>().enabled = true;
GameScreen.GetComponent<Canvas>().enabled = false;
}
}

View File

@ -1,2 +1,2 @@
fileFormatVersion: 2
guid: 1a7d82f7fad541f78df7016101d3e776
guid: 1f8312d9157842a9af56e830533c076e

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<QCARConfig>
<Tracking>
<ImageTarget name="Na" size="1.000000 1.000000" />
<ImageTarget name="C" size="1.000000 1.000000" />
<ImageTarget name="O" size="1.000000 1.000000" />
<ImageTarget name="H" size="1.000000 1.000000" />

View File

@ -1,2 +1,2 @@
fileFormatVersion: 2
guid: 7c69adbb1eb240618f9f726726ddbe54
guid: 4b6f1d2c047e4730a77d53f36d5d507d

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8e7e8f5a82a3a134e91c54efd2274ea9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 1b8d251f9af63b746bf2f7ffe00ebb9b
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because one or more lines are too long

View File

@ -262,7 +262,7 @@ PrefabInstance:
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 2115541903}
m_TransformParent: {fileID: 2030766766}
m_Modifications:
- target: {fileID: 2296197579250447769, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_Name
@ -274,11 +274,11 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalPosition.x
value: 0
value: 2.331
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalPosition.y
value: 0.234
value: -0.004999995
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalPosition.z
@ -290,15 +290,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalRotation.x
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalRotation.y
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalRotation.z
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@ -322,6 +322,154 @@ Transform:
m_CorrespondingSourceObject: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
m_PrefabInstance: {fileID: 52111041}
m_PrefabAsset: {fileID: 0}
--- !u!1 &73440020
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 73440021}
- component: {fileID: 73440024}
- component: {fileID: 73440023}
- component: {fileID: 73440022}
m_Layer: 0
m_Name: Na
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &73440021
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 73440020}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 1.329}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 2141458387}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &73440022
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 73440020}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 1778676317, guid: 8a9a760f95896c34689febc965510927, type: 3}
m_Name:
m_EditorClassIdentifier:
mObserverBehaviour: {fileID: 73440024}
mHiddenRoot: {fileID: 0}
mTargetName: Na
mDatasetName: Vuforia/T-VIR.xml
mCastedBehaviour: {fileID: 73440024}
mMeshFilter: {fileID: 0}
mMeshRenderer: {fileID: 0}
--- !u!114 &73440023
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 73440020}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 886328de6a5c14cbb85854fdf1a5085b, type: 3}
m_Name:
m_EditorClassIdentifier:
StatusFilter: 0
UsePoseSmoothing: 0
AnimationCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 3.3333333
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
- serializedVersion: 3
time: 0.3
value: 1
inSlope: 3.3333333
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0
outWeight: 0
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
OnTargetFound:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1201501054}
m_TargetAssemblyTypeName: ActiveScoppedElements, Assembly-CSharp
m_MethodName: AddScoppedElement
m_Mode: 5
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument: Na
m_BoolArgument: 0
m_CallState: 2
OnTargetLost:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1201501054}
m_TargetAssemblyTypeName: ActiveScoppedElements, Assembly-CSharp
m_MethodName: RemoveUnscoppedElement
m_Mode: 5
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument: Na
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &73440024
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 73440020}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -1631628248, guid: 8a9a760f95896c34689febc965510927, type: 3}
m_Name:
m_EditorClassIdentifier:
PreviewVisible: 1
RuntimeOcclusion: 0
RuntimeCollider: 0
mTrackableName: Na
mInitializedInEditor: 1
mDataSetPath: Vuforia/T-VIR.xml
mAspectRatio: 1
mImageTargetType: 0
mWidth: 1
mHeight: 1
mRuntimeTexture: {fileID: 0}
mMotionHint: 1
mTrackingOptimization: 0
mTrackingOptimizationNeedsUpgrade: 0
mPreview: {fileID: 73440022}
--- !u!1 &239149474
GameObject:
m_ObjectHideFlags: 0
@ -567,7 +715,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 231.8, y: 554}
m_AnchoredPosition: {x: 231.8, y: 692.3}
m_SizeDelta: {x: 150, y: 50.179993}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &246236246
@ -1280,7 +1428,7 @@ PrefabInstance:
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1344363834}
m_TransformParent: {fileID: 2030766766}
m_Modifications:
- target: {fileID: 2296197579250447769, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_Name
@ -1292,11 +1440,11 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalPosition.x
value: 0
value: 3.45
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalPosition.y
value: 0.234
value: -0.004999995
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalPosition.z
@ -1308,15 +1456,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalRotation.x
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalRotation.y
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalRotation.z
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@ -1550,6 +1698,139 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 877453050}
m_CullTransparentMesh: 1
--- !u!1 &877864514
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 877864515}
- component: {fileID: 877864518}
- component: {fileID: 877864517}
- component: {fileID: 877864516}
m_Layer: 5
m_Name: LockBtn
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!224 &877864515
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 877864514}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -54}
m_LocalScale: {x: 2, y: 2, z: 2}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1963975536}
m_Father: {fileID: 1176767512}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 231.8, y: 554}
m_SizeDelta: {x: 150, y: 50.179993}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &877864516
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 877864514}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 877864517}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 1201501054}
m_TargetAssemblyTypeName: ActiveScoppedElements, Assembly-CSharp
m_MethodName: onClickToggleLockMode
m_Mode: 1
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &877864517
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 877864514}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!222 &877864518
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 877864514}
m_CullTransparentMesh: 1
--- !u!1 &883501566
GameObject:
m_ObjectHideFlags: 0
@ -1996,6 +2277,7 @@ RectTransform:
- {fileID: 1903101193}
- {fileID: 1640489757}
- {fileID: 246236245}
- {fileID: 877864515}
- {fileID: 418945366}
- {fileID: 595129154}
- {fileID: 245608582}
@ -2014,7 +2296,7 @@ PrefabInstance:
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 2082618016}
m_TransformParent: {fileID: 2030766766}
m_Modifications:
- target: {fileID: 2296197579250447769, guid: 7c22f7e0b871cb14fa1ad0765c00dfeb, type: 3}
propertyPath: m_Name
@ -2030,7 +2312,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: 7c22f7e0b871cb14fa1ad0765c00dfeb, type: 3}
propertyPath: m_LocalPosition.y
value: 0.239
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: 7c22f7e0b871cb14fa1ad0765c00dfeb, type: 3}
propertyPath: m_LocalPosition.z
@ -2042,15 +2324,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: 7c22f7e0b871cb14fa1ad0765c00dfeb, type: 3}
propertyPath: m_LocalRotation.x
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: 7c22f7e0b871cb14fa1ad0765c00dfeb, type: 3}
propertyPath: m_LocalRotation.y
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: 7c22f7e0b871cb14fa1ad0765c00dfeb, type: 3}
propertyPath: m_LocalRotation.z
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: 7c22f7e0b871cb14fa1ad0765c00dfeb, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@ -2119,9 +2401,11 @@ MonoBehaviour:
- {fileID: 245608581}
- {fileID: 19813356}
- {fileID: 1106826236}
- {fileID: 877864514}
DebugObjs:
- {fileID: 239149474}
- {fileID: 436501310}
atomPrefabToInstantiate: {fileID: 4409383611147121166, guid: d9d5dcbc28f5ad041b1b60b004ccf890, type: 3}
--- !u!114 &1201501055
MonoBehaviour:
m_ObjectHideFlags: 0
@ -2188,7 +2472,7 @@ PrefabInstance:
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1305875256}
m_TransformParent: {fileID: 2030766766}
m_Modifications:
- target: {fileID: 2296197579250447769, guid: 7c22f7e0b871cb14fa1ad0765c00dfeb, type: 3}
propertyPath: m_Name
@ -2204,7 +2488,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: 7c22f7e0b871cb14fa1ad0765c00dfeb, type: 3}
propertyPath: m_LocalPosition.y
value: 0.239
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: 7c22f7e0b871cb14fa1ad0765c00dfeb, type: 3}
propertyPath: m_LocalPosition.z
@ -2216,15 +2500,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: 7c22f7e0b871cb14fa1ad0765c00dfeb, type: 3}
propertyPath: m_LocalRotation.x
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: 7c22f7e0b871cb14fa1ad0765c00dfeb, type: 3}
propertyPath: m_LocalRotation.y
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: 7c22f7e0b871cb14fa1ad0765c00dfeb, type: 3}
propertyPath: m_LocalRotation.z
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: 7c22f7e0b871cb14fa1ad0765c00dfeb, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@ -2413,8 +2697,7 @@ Transform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1292191404}
m_Children: []
m_Father: {fileID: 2141458387}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1305875257
@ -2562,8 +2845,7 @@ Transform:
m_LocalPosition: {x: 3.45, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 692418288}
m_Children: []
m_Father: {fileID: 2141458387}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1344363835
@ -2764,8 +3046,8 @@ MonoBehaviour:
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 24
m_fontSizeBase: 24
m_fontSize: 18
m_fontSizeBase: 18
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
@ -2979,8 +3261,7 @@ Transform:
m_LocalPosition: {x: 1.134, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1843136735}
m_Children: []
m_Father: {fileID: 2141458387}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1576193662
@ -3581,7 +3862,7 @@ PrefabInstance:
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1576193661}
m_TransformParent: {fileID: 2030766766}
m_Modifications:
- target: {fileID: 2296197579250447769, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_Name
@ -3593,11 +3874,11 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalPosition.x
value: 0
value: 1.134
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalPosition.y
value: 0.234
value: -0.004999995
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalPosition.z
@ -3609,15 +3890,15 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalRotation.x
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalRotation.y
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalRotation.z
value: 0
value: -0
objectReference: {fileID: 0}
- target: {fileID: 4757697444972247267, guid: ae2d2b687aff85b46a01c62e312954d2, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
@ -3985,6 +4266,176 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1914407046}
m_CullTransparentMesh: 1
--- !u!1 &1963975535
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1963975536}
- component: {fileID: 1963975538}
- component: {fileID: 1963975537}
m_Layer: 5
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1963975536
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1963975535}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 877864515}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1963975537
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1963975535}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: Lock/Unlock
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []
m_fontColor32:
serializedVersion: 2
rgba: 4281479730
m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_enableVertexGradient: 0
m_colorMode: 3
m_fontColorGradient:
topLeft: {r: 1, g: 1, b: 1, a: 1}
topRight: {r: 1, g: 1, b: 1, a: 1}
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
bottomRight: {r: 1, g: 1, b: 1, a: 1}
m_fontColorGradientPreset: {fileID: 0}
m_spriteAsset: {fileID: 0}
m_tintAllSprites: 0
m_StyleSheet: {fileID: 0}
m_TextStyleHashCode: -1183493901
m_overrideHtmlColors: 0
m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 18
m_fontSizeBase: 18
m_fontWeight: 400
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0
m_HorizontalAlignment: 2
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0
m_lineSpacing: 0
m_lineSpacingMax: 0
m_paragraphSpacing: 0
m_charWidthMaxAdj: 0
m_enableWordWrapping: 1
m_wordWrappingRatios: 0.4
m_overflowMode: 0
m_linkedTextComponent: {fileID: 0}
parentLinkedComponent: {fileID: 0}
m_enableKerning: 1
m_enableExtraPadding: 0
checkPaddingRequired: 0
m_isRichText: 1
m_parseCtrlCharacters: 1
m_isOrthographic: 1
m_isCullingEnabled: 0
m_horizontalMapping: 0
m_verticalMapping: 0
m_uvLineOffset: 0
m_geometrySortingOrder: 0
m_IsTextObjectScaleStatic: 0
m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 0}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!222 &1963975538
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1963975535}
m_CullTransparentMesh: 1
--- !u!1 &2030766765
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2030766766}
m_Layer: 0
m_Name: TMP
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &2030766766
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2030766765}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0.239, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1193470964}
- {fileID: 1292191404}
- {fileID: 1843136735}
- {fileID: 52111042}
- {fileID: 692418288}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2082618015
GameObject:
m_ObjectHideFlags: 0
@ -4016,8 +4467,7 @@ Transform:
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1193470964}
m_Children: []
m_Father: {fileID: 2141458387}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2082618017
@ -4165,8 +4615,7 @@ Transform:
m_LocalPosition: {x: 2.331, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 52111042}
m_Children: []
m_Father: {fileID: 2141458387}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2115541904
@ -4507,6 +4956,7 @@ Transform:
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2082618016}
- {fileID: 73440021}
- {fileID: 1305875256}
- {fileID: 1576193661}
- {fileID: 2115541903}
@ -4598,3 +5048,4 @@ SceneRoots:
- {fileID: 1176767512}
- {fileID: 2138147404}
- {fileID: 1112541706}
- {fileID: 2030766766}

File diff suppressed because it is too large Load Diff

3802
Assets/__Scenes/tmp.unity Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 2c5db3808697d5d42bef016039ab3370
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

8
Assets/script/Atome.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d277baeb8e7f7794fb44493815552a02
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,139 @@
using System;
using System.Collections.Generic;
using UnityEngine;
public class AtomeFactory : MonoBehaviour{
public TextAsset jsonFile;
private static AtomeFactory instance;
private AtomesInformation atomeInJson;
private Dictionary<string, AtomeInformation> AtomeDictionary;
public AtomeFactory(TextAsset jsonFile){
AtomeFactory.instance = this;
AtomeDictionary = new Dictionary<string, AtomeInformation>();
atomeInJson = JsonUtility.FromJson<AtomesInformation>(jsonFile.text);
foreach (var atome in atomeInJson.atomes){
AtomeDictionary.Add(atome.symbol, atome);
}
}
public static AtomeFactory getInstrance(){
if(AtomeFactory.instance == null){
Debug.LogError("no Json file");
}
return AtomeFactory.instance;
}
public static AtomeFactory getInstrance(TextAsset jsonFile){
if(AtomeFactory.instance == null){
AtomeFactory.instance = new AtomeFactory(jsonFile);
}
return AtomeFactory.instance;
}
public bool hasAtome(String symbol)
{
return AtomeDictionary.ContainsKey(symbol);
}
public AtomeInformation createAtome(string symbol){
if(!AtomeDictionary.ContainsKey(symbol)){
Debug.LogError("Atome does not existe in json");
return null;
}
AtomeInformation atome = AtomeDictionary[symbol];
return atome;
}
public GameObject createAnimatedAtome(string symbol) {
if(!AtomeDictionary.ContainsKey(symbol)){
Debug.LogError("Atome does not existe in json");
return null;
}
AtomeInformation atomeinfo = AtomeDictionary[symbol];
GameObject Parent = new GameObject(atomeinfo.name);
int ElectronsNumber = atomeinfo.protons;
//Symbol
GameObject atome = CreateSymbolAnimation(atomeinfo);
atome.transform.parent = Parent.transform;
//Electrons
for (int i = 1; ElectronsNumber > 0; i++) {
int nbrElectronLayer = 2 * (i * i);
GameObject electrons = CreateElectronsAnimation(Mathf.Min(ElectronsNumber, nbrElectronLayer), (float)i);
electrons.transform.parent = Parent.transform;
ElectronsNumber -= nbrElectronLayer;
}
//rajouter electron == protons
return Parent;
}
private GameObject DrawCircle(float orbitRadius)
{
GameObject orbitCircle = new GameObject("Orbit Circle");
LineRenderer lineRenderer = orbitCircle.AddComponent<LineRenderer>();
lineRenderer.useWorldSpace = false;
lineRenderer.widthMultiplier = 0.03f; // Ajustez l'épaisseur de la ligne si nécessaire.
lineRenderer.positionCount = 100 + 1;
//Add Color
Color myColor = new Color(0, 0, 1, 1);
ColorUtility.TryParseHtmlString("#7F7F7F", out myColor);
orbitCircle.GetComponent<Renderer>().material.color = myColor;
for (int i = 0; i <= 100; i++)
{
float angle = i * 2 * Mathf.PI / 100;
float x = Mathf.Cos(angle) * orbitRadius;
float y = Mathf.Sin(angle) * orbitRadius;
lineRenderer.SetPosition(i, new Vector3(x, 0f, y));
}
return orbitCircle;
}
private GameObject CreateSymbolAnimation(AtomeInformation info) {
//Create GameObject
GameObject sphere = GameObject.CreatePrimitive(PrimitiveType.Sphere);
//Add information
sphere.name = info.symbol;
sphere.transform.position = new Vector3(0, 0, 0);
//Add Color
Color myColor = new Color(0, 0, 1, 1);
ColorUtility.TryParseHtmlString(info.representation.color, out myColor);
sphere.GetComponent<Renderer>().material.color = myColor;
return sphere;
}
private GameObject CreateElectronsAnimation(int electrons, float layer) {
GameObject ParentLayer = new GameObject("Electrons");
for (int i = 0; i < electrons; i++) {
float angle = i * Mathf.PI * 2 / electrons;
float x = Mathf.Cos(angle) * layer;
float z = Mathf.Sin(angle) * layer;
float y = 0f;
GameObject electron = GameObject.CreatePrimitive(PrimitiveType.Sphere);
electron.name = "Electron" + i;
electron.transform.position = new Vector3(x, y, z);
electron.transform.localScale = new Vector3(0.3f, 0.3f, 0.3f);
electron.transform.parent = ParentLayer.transform;
}
GameObject orbit = DrawCircle(layer);
orbit.transform.parent = ParentLayer.transform;
return ParentLayer;
}
}

View File

@ -1,49 +0,0 @@
using System;
using System.Collections.Generic;
using UnityEngine;
public class AtomeFactory : MonoBehaviour{
public TextAsset jsonFile;
private static AtomeFactory instance;
private AtomesInformation atomeInJson;
private Dictionary<string, AtomeInformation> AtomeDictionary;
public AtomeFactory(TextAsset jsonFile){
AtomeFactory.instance = this;
AtomeDictionary = new Dictionary<string, AtomeInformation>();
atomeInJson = JsonUtility.FromJson<AtomesInformation>(jsonFile.text);
foreach (var atome in atomeInJson.atomes){
AtomeDictionary.Add(atome.symbol, atome);
}
}
public static AtomeFactory getInstrance() {
if(AtomeFactory.instance == null){
Debug.LogError("no Json file");
}
return AtomeFactory.instance;
}
public static AtomeFactory getInstrance(TextAsset jsonFile){
if(AtomeFactory.instance == null){
AtomeFactory.instance = new AtomeFactory(jsonFile);
}
return AtomeFactory.instance;
}
public AtomeInformation createAtome(string symbol){
if(!AtomeDictionary.ContainsKey(symbol)){
Debug.LogError("Atome does not existe in json");
}
AtomeInformation atome = AtomeDictionary[symbol];
return atome;
}
}

View File

@ -11,14 +11,14 @@ class MoleculeFactoryTester: MonoBehaviour {
public TextAsset atomJson;
void Start(){
MoleculeFactory factory = MoleculeFactory.getInstrance(this.moleculeJson);
/*MoleculeFactory factory = MoleculeFactory.getInstrance(this.moleculeJson);
AtomeFactory atomeFactory = AtomeFactory.getInstrance(this.atomJson);
factory.setAtomFactory(atomeFactory);
GameObject mol = factory.createMolecule("O2");
GameObject mol2 = factory.createMolecule("H2O");
mol.transform.position = new Vector3(0,1,0);
GameObject mol3 = factory.createMolecule("C4H10");
mol3.transform.position = new Vector3(0,5,0);
mol3.transform.position = new Vector3(0,5,0);*/
//GameObject bon = GameOject.CreatePrimitive(PrimitiveType.)
}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: daab5552b7014024c9b81a31c7eb0b12
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -104,6 +104,11 @@ public class MoleculeFactory : MonoBehaviour{
this.atomeFactory = atomeFactory;
}
public AtomeFactory GetAtomFactory()
{
return this.atomeFactory;
}
private GameObject CreateCylinderBetweenPoints(Vector3 start, Vector3 end, float width){
var offset = end - start;
var scale = new Vector3(width, offset.magnitude / 2.0f, width);

View File

@ -0,0 +1,53 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: New Animation
serializedVersion: 7
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 3f4a98ccdd3a2514495ffff7ef525aa7
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,12 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: New Animator Controller
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers: []

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 825a7187bec92284dbce290965de4dba
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:

View File

@ -15,6 +15,13 @@
"dependencies": {},
"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": {
"version": "1.0.0",
"depth": 1,

View File

@ -1,9 +1,22 @@
# T-VIR-901
> Unity Editor version to use: Unity 2022.3.11f1
> Unity Editor version à utiliser: Unity 2022.3.11f1
## Installation
Github mirroir (https://github.com/EpitechMscProPromo2024/T-VIR-901-NAN_1)
## Configuration
## Accès à l'application
L'application est maintenant accessible sur le Play Store en tant qu'application bêta ouverte destinée aux testeurs internes. Pour y accéder, veuillez faire une demande pour être ajouté à la liste des testeurs bêta en contactant l'un des développeurs suivants :
- Nicolas SANS (nicolas.sansd@gmail.com)
- Mathis RAGOT (mathis.ragot@epitech.eu)
- Clément BOESMIER (clement.boesmier@epitech.eu)
- Gildas GONZALEZ (gildas.gonzalez@epitech.eu)
Une fois l'accès accordé, vous pouvez retrouver l'application en suivant ce lien :
https://play.google.com/store/apps/details?id=com.DefaultCompany.TVIR901
Lien des QRCodes pour afficher les molécules et atomes
https://drive.google.com/drive/folders/1DhQNkJQinPD4lftVDK2BHNPfEnNlAMOX?usp=sharing
## License