diff --git a/Assets/Scenes/Level/TShapeCorridor.unity b/Assets/Scenes/Level/TShapeCorridor.unity index fd9b1a5..fe0ccb1 100644 --- a/Assets/Scenes/Level/TShapeCorridor.unity +++ b/Assets/Scenes/Level/TShapeCorridor.unity @@ -153,12 +153,12 @@ PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: - m_TransformParent: {fileID: 0} + m_TransformParent: {fileID: 893021094} m_Modifications: - target: {fileID: 6126321952314205284, guid: 2c375dba610d6c24c84f9941cfd92de9, type: 3} propertyPath: m_RootOrder - value: 4 + value: 8 objectReference: {fileID: 0} - target: {fileID: 6126321952314205284, guid: 2c375dba610d6c24c84f9941cfd92de9, type: 3} @@ -173,17 +173,17 @@ PrefabInstance: - target: {fileID: 6126321952314205284, guid: 2c375dba610d6c24c84f9941cfd92de9, type: 3} propertyPath: m_LocalPosition.x - value: 1 + value: -14.430971 objectReference: {fileID: 0} - target: {fileID: 6126321952314205284, guid: 2c375dba610d6c24c84f9941cfd92de9, type: 3} propertyPath: m_LocalPosition.y - value: 0 + value: 3.967269 objectReference: {fileID: 0} - target: {fileID: 6126321952314205284, guid: 2c375dba610d6c24c84f9941cfd92de9, type: 3} propertyPath: m_LocalPosition.z - value: -10 + value: -10.335577 objectReference: {fileID: 0} - target: {fileID: 6126321952314205284, guid: 2c375dba610d6c24c84f9941cfd92de9, type: 3} @@ -193,17 +193,17 @@ PrefabInstance: - target: {fileID: 6126321952314205284, guid: 2c375dba610d6c24c84f9941cfd92de9, type: 3} propertyPath: m_LocalRotation.x - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 6126321952314205284, guid: 2c375dba610d6c24c84f9941cfd92de9, type: 3} propertyPath: m_LocalRotation.y - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 6126321952314205284, guid: 2c375dba610d6c24c84f9941cfd92de9, type: 3} propertyPath: m_LocalRotation.z - value: 0 + value: -0 objectReference: {fileID: 0} - target: {fileID: 6126321952314205284, guid: 2c375dba610d6c24c84f9941cfd92de9, type: 3} @@ -227,6 +227,12 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 2c375dba610d6c24c84f9941cfd92de9, type: 3} +--- !u!4 &18631108 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 6126321952314205284, guid: 2c375dba610d6c24c84f9941cfd92de9, + type: 3} + m_PrefabInstance: {fileID: 18631107} + m_PrefabAsset: {fileID: 0} --- !u!1001 &30575960 PrefabInstance: m_ObjectHideFlags: 0 @@ -319,8 +325,8 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 48185826} - m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068} - m_LocalPosition: {x: -10, y: 1, z: -3.5} + m_LocalRotation: {x: -0, y: 0.7071068, z: -0, w: 0.7071068} + m_LocalPosition: {x: -25.430971, y: 4.967269, z: -3.835577} m_LocalScale: {x: 1, y: 5, z: 1} m_Children: - {fileID: 1246230281} @@ -330,8 +336,8 @@ Transform: - {fileID: 1850309953} - {fileID: 1043483513} - {fileID: 2014407186} - m_Father: {fileID: 0} - m_RootOrder: 13 + m_Father: {fileID: 893021094} + m_RootOrder: 7 m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} --- !u!1001 &78390625 PrefabInstance: @@ -402,6 +408,12 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 4e43359aa0ae4244884e8e0e509457ee, type: 3} +--- !u!1 &83137245 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3445185087018901938, guid: 1d0368ccaf6b0f6418f73a0180971465, + type: 3} + m_PrefabInstance: {fileID: 1301935130} + m_PrefabAsset: {fileID: 0} --- !u!1 &84392110 stripped GameObject: m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 4e43359aa0ae4244884e8e0e509457ee, @@ -544,8 +556,8 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 102875128} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 11, y: 1, z: -11} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -4.430971, y: 4.967269, z: -11.335577} m_LocalScale: {x: 1, y: 5, z: 1} m_Children: - {fileID: 759226313} @@ -553,8 +565,8 @@ Transform: - {fileID: 1167787382} - {fileID: 858310225} - {fileID: 2047138098} - m_Father: {fileID: 0} - m_RootOrder: 8 + m_Father: {fileID: 893021094} + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &106664543 stripped GameObject: @@ -1274,8 +1286,8 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 348219096} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 18, y: 1, z: -5} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 2.5690289, y: 4.967269, z: -5.335577} m_LocalScale: {x: 1, y: 5, z: 1} m_Children: - {fileID: 802292586} @@ -1283,8 +1295,8 @@ Transform: - {fileID: 1772951329} - {fileID: 1382195998} - {fileID: 84392111} - m_Father: {fileID: 0} - m_RootOrder: 9 + m_Father: {fileID: 893021094} + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &350113558 PrefabInstance: @@ -1378,8 +1390,8 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 381104971} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 6, y: 1, z: -11} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -9.430971, y: 4.967269, z: -11.335577} m_LocalScale: {x: 1, y: 5, z: 1} m_Children: - {fileID: 1295368865} @@ -1387,8 +1399,8 @@ Transform: - {fileID: 2059677937} - {fileID: 1429141105} - {fileID: 1164575681} - m_Father: {fileID: 0} - m_RootOrder: 6 + m_Father: {fileID: 893021094} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &385407870 PrefabInstance: @@ -1482,8 +1494,8 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 442812426} - m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068} - m_LocalPosition: {x: 9, y: 1, z: -3.5} + m_LocalRotation: {x: -0, y: 0.7071068, z: -0, w: 0.7071068} + m_LocalPosition: {x: -6.430971, y: 4.967269, z: -3.835577} m_LocalScale: {x: 1, y: 5, z: 1} m_Children: - {fileID: 556043408} @@ -1493,8 +1505,8 @@ Transform: - {fileID: 303684793} - {fileID: 108728861} - {fileID: 345655008} - m_Father: {fileID: 0} - m_RootOrder: 11 + m_Father: {fileID: 893021094} + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} --- !u!1 &459110079 stripped GameObject: @@ -1845,8 +1857,8 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 532089989} - m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 1, z: 1} + m_LocalRotation: {x: -0, y: 0.7071068, z: -0, w: 0.7071068} + m_LocalPosition: {x: -15.430971, y: 4.967269, z: 0.664423} m_LocalScale: {x: 1, y: 5, z: 1} m_Children: - {fileID: 1731891296} @@ -1864,8 +1876,8 @@ Transform: - {fileID: 170236133} - {fileID: 1715611891} - {fileID: 911665831} - m_Father: {fileID: 0} - m_RootOrder: 12 + m_Father: {fileID: 893021094} + m_RootOrder: 6 m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} --- !u!1001 &554109607 PrefabInstance: @@ -2995,6 +3007,45 @@ BoxCollider: serializedVersion: 2 m_Size: {x: 2, y: 2, z: 0.7} m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &893021093 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 893021094} + m_Layer: 0 + m_Name: WallAndFloor + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &893021094 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 893021093} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 15.430971, y: -3.967269, z: 0.335577} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 381104972} + - {fileID: 1825695030} + - {fileID: 102875129} + - {fileID: 348219097} + - {fileID: 1672087634} + - {fileID: 442812427} + - {fileID: 532089990} + - {fileID: 48185827} + - {fileID: 18631108} + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &911665830 stripped GameObject: m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 4e43359aa0ae4244884e8e0e509457ee, @@ -3180,7 +3231,7 @@ Transform: m_LocalScale: {x: 1, y: 1, z: 1} m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} --- !u!1 &976150997 stripped GameObject: @@ -3928,6 +3979,12 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 4e43359aa0ae4244884e8e0e509457ee, type: 3} +--- !u!1 &1246066623 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 3445185087018901938, guid: 1d0368ccaf6b0f6418f73a0180971465, + type: 3} + m_PrefabInstance: {fileID: 1910729968} + m_PrefabAsset: {fileID: 0} --- !u!1 &1246230280 stripped GameObject: m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 4e43359aa0ae4244884e8e0e509457ee, @@ -5147,6 +5204,52 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 4e43359aa0ae4244884e8e0e509457ee, type: 3} +--- !u!1 &1495085022 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1495085024} + - component: {fileID: 1495085023} + m_Layer: 0 + m_Name: ScriptForDemonSpawnOfEeeeeeevil + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1495085023 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1495085022} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f3f477d3a51f97a44b091626e4aa19db, type: 3} + m_Name: + m_EditorClassIdentifier: + listeCommeTuVeux: + - {fileID: 83137245} + - {fileID: 1246066623} +--- !u!4 &1495085024 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1495085022} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 15.430971, y: -3.967269, z: 0.335577} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1506743340 stripped GameObject: m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: 4e43359aa0ae4244884e8e0e509457ee, @@ -5615,8 +5718,8 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1672087633} - m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068} - m_LocalPosition: {x: 0, y: 1, z: -13} + m_LocalRotation: {x: -0, y: 0.7071068, z: -0, w: 0.7071068} + m_LocalPosition: {x: -15.430971, y: 4.967269, z: -13.335577} m_LocalScale: {x: 1, y: 5, z: 1} m_Children: - {fileID: 135399646} @@ -5634,8 +5737,8 @@ Transform: - {fileID: 1528586323} - {fileID: 753083697} - {fileID: 699636817} - m_Father: {fileID: 0} - m_RootOrder: 10 + m_Father: {fileID: 893021094} + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0} --- !u!1001 &1678847543 PrefabInstance: @@ -6312,8 +6415,8 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1825695029} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -1, y: 1, z: -5} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -16.430971, y: 4.967269, z: -5.335577} m_LocalScale: {x: 1, y: 5, z: 1} m_Children: - {fileID: 1455878243} @@ -6321,8 +6424,8 @@ Transform: - {fileID: 1720376778} - {fileID: 2048937072} - {fileID: 1333404391} - m_Father: {fileID: 0} - m_RootOrder: 7 + m_Father: {fileID: 893021094} + m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &1831876919 PrefabInstance: diff --git a/Assets/Scripts/HammerScript/Executable.cs b/Assets/Scripts/HammerScript/Executable.cs index 83094b7..28bf9a2 100644 --- a/Assets/Scripts/HammerScript/Executable.cs +++ b/Assets/Scripts/HammerScript/Executable.cs @@ -1,5 +1,7 @@ using System.Collections; using System.Collections.Generic; +using Assets.Scripts; +using Assets.Scripts.Utilities; using UnityEngine; using UnityEngine.UI; using static MovementGen; @@ -10,15 +12,17 @@ public class Executable : MonoBehaviour public Timer timer; public string NextScene; public TextMesh text; - public bool IsQuickTeleport = false; public bool noMovementChange = true; public bool bloquer = false; public ChoiceOfMovement nextMouv; - + + // Si on veut skipper/bypasser le 5-4-3-2-1 + public bool IsQuickTeleport = false; + void Start() { //Set the tag of this GameObject to Player - gameObject.tag = "Target"; + gameObject.tag = Constant.GT_TARGET; if(noMovementChange) text.text = ""; else @@ -35,7 +39,7 @@ public class Executable : MonoBehaviour } if (!noMovementChange) { - PlayerPrefs.SetInt("mouvement", (int)nextMouv); + PlayerPrefs.SetInt(Constant.PPK_MOVEMENT_CHOICE, (int)nextMouv); } if (IsQuickTeleport) { @@ -48,6 +52,7 @@ public class Executable : MonoBehaviour } } + private int count = 0; IEnumerator TimerExecute() { @@ -61,9 +66,10 @@ public class Executable : MonoBehaviour else text.text = "Done"; } - + yield return new WaitForSeconds(1.5f); + DataSaver.SaveTime(); if (count <= 0) { SceneManager.LoadScene(NextScene); diff --git a/Assets/Scripts/HammerScript/HammerTrigger.cs b/Assets/Scripts/HammerScript/HammerTrigger.cs index 9104d46..3879053 100644 --- a/Assets/Scripts/HammerScript/HammerTrigger.cs +++ b/Assets/Scripts/HammerScript/HammerTrigger.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Collections.Generic; +using Assets.Scripts; using UnityEngine; public class HammerTrigger : MonoBehaviour @@ -7,7 +8,7 @@ public class HammerTrigger : MonoBehaviour // Start is called before the first frame update void Start() { - gameObject.tag = "Hammer"; + gameObject.tag = Constant.GT_HAMMER; } // Update is called once per frame @@ -19,7 +20,7 @@ public class HammerTrigger : MonoBehaviour private void OnTriggerEnter(Collider other) { Debug.Log("Hammer detected the colision"); - if (other.gameObject.tag == "Target") + if (other.gameObject.tag == Constant.GT_TARGET) { Executable ex = other.gameObject.GetComponent("Executable") as Executable; ex.Execute(); diff --git a/Assets/Scripts/MovementGen.cs b/Assets/Scripts/MovementGen.cs index 6d393c4..8b363f5 100644 --- a/Assets/Scripts/MovementGen.cs +++ b/Assets/Scripts/MovementGen.cs @@ -1,5 +1,7 @@ +using System; using System.Collections; using System.Collections.Generic; +using Assets.Scripts; using Assets.Scripts.Movements; using UnityEngine; @@ -9,7 +11,7 @@ public class MovementGen : MonoBehaviour private ChoiceOfMovement currentMovement; [SerializeField] private ChoiceOfMovement selectedMovement; - + [SerializeField] private String nomDuJoueur = string.Empty; // Start is called before the first frame update void Start() @@ -21,10 +23,15 @@ public class MovementGen : MonoBehaviour components.Add(ChoiceOfMovement.joycon, this.GetComponent()); components.Add(ChoiceOfMovement.omni, this.GetComponent()); - selectedMovement = (ChoiceOfMovement)PlayerPrefs.GetInt("mouvement", 0); - currentMovement = (ChoiceOfMovement)PlayerPrefs.GetInt("mouvement", 0); + selectedMovement = (ChoiceOfMovement)PlayerPrefs.GetInt(Constant.PPK_MOVEMENT_CHOICE, 0); + currentMovement = (ChoiceOfMovement)PlayerPrefs.GetInt(Constant.PPK_MOVEMENT_CHOICE, 0); components[currentMovement].enabled = true; - + + if (nomDuJoueur == string.Empty) + { + nomDuJoueur = DateTime.Now.ToString("MM-dd HH:mm"); + } + PlayerPrefs.SetString(Constant.PPK_PLAYER_NAME, nomDuJoueur); } // Update is called once per frame diff --git a/Assets/Scripts/RandomDemonSpawn.cs b/Assets/Scripts/RandomDemonSpawn.cs new file mode 100644 index 0000000..33240f5 --- /dev/null +++ b/Assets/Scripts/RandomDemonSpawn.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Random = System.Random; + +public class RandomDemonSpawn : MonoBehaviour +{ + public GameObject[] listeCommeTuVeux; + + // Start is called before the first frame update + void Start() + { + Random rnd = new Random(); + int card = rnd.Next(1, 3); + + listeCommeTuVeux[0].SetActive(card == 1); + listeCommeTuVeux[1].SetActive(card != 1); + } + + // Update is called once per frame + void Update() + { + + } +} diff --git a/Assets/Scripts/RandomDemonSpawn.cs.meta b/Assets/Scripts/RandomDemonSpawn.cs.meta new file mode 100644 index 0000000..8485237 --- /dev/null +++ b/Assets/Scripts/RandomDemonSpawn.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: f3f477d3a51f97a44b091626e4aa19db +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Utilities/Constant.cs b/Assets/Scripts/Utilities/Constant.cs new file mode 100644 index 0000000..266f7ce --- /dev/null +++ b/Assets/Scripts/Utilities/Constant.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Assets.Scripts +{ + class Constant + { + // Files + public const string FILE_TIME = "TimeFile.txt"; + + // Game Tag + public const string GT_TARGET = "Target"; + public const string GT_HAMMER = "Hammer"; + + // Player Prefs Keys + public const string PPK_PLAYER_NAME = "PlayerName"; + public const string PPK_TIMER_TIME = "Time"; + public const string PPK_MOVEMENT_CHOICE = "mouvement"; + } +} diff --git a/Assets/Scripts/Utilities/DataSaver.cs b/Assets/Scripts/Utilities/DataSaver.cs new file mode 100644 index 0000000..8d64bf5 --- /dev/null +++ b/Assets/Scripts/Utilities/DataSaver.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using UnityEngine; + +namespace Assets.Scripts.Utilities +{ + class DataSaver + { + public static void SaveTime() + { + //Nom du mouvement - Nom du joueur - Stage - Temps d'exécution + string playerName = PlayerPrefs.GetString(Constant.PPK_PLAYER_NAME); + string movementName = ((MovementGen.ChoiceOfMovement)PlayerPrefs.GetInt(Constant.PPK_MOVEMENT_CHOICE)).ToString(); + string time = PlayerPrefs.GetString(Constant.PPK_TIMER_TIME); + string stage = ""; // TODO + string toSave = movementName + " - " + playerName + " - " + stage + " - "+ time; + writeToFile(toSave); + } + + private static async void writeToFile(string toSave) + { + using StreamWriter file = new(Constant.FILE_TIME); + + await file.WriteLineAsync(toSave); + } + + // TODO writeToFile(toSave, fileName) pour les positions + } +} diff --git a/Assets/Scripts/Timer.cs b/Assets/Scripts/Utilities/Timer.cs similarity index 79% rename from Assets/Scripts/Timer.cs rename to Assets/Scripts/Utilities/Timer.cs index e827ef4..30e4c7e 100644 --- a/Assets/Scripts/Timer.cs +++ b/Assets/Scripts/Utilities/Timer.cs @@ -1,5 +1,6 @@ using System.Collections; using System.Collections.Generic; +using Assets.Scripts; using UnityEngine; using UnityEngine.UI; @@ -8,8 +9,10 @@ public class Timer : MonoBehaviour private float time { get; set; } private bool timerStop { get; set; } + // TODO JIMMY : Rename this [SerializeField] - private TextMesh text; + private TextMesh text; + // TODO JIMMY : ^ Rename this private Coroutine timerRoutine; @@ -20,16 +23,15 @@ public class Timer : MonoBehaviour timerRoutine = StartCoroutine("TimerExecute"); } - private void FixedUpdate() - { - + private void FixedUpdate() + { } public void Stop() { timerStop = true; - PlayerPrefs.SetString("Time", text.text); + PlayerPrefs.SetString(Constant.PPK_TIMER_TIME, text.text); StopCoroutine(timerRoutine); } diff --git a/Assets/Scripts/Timer.cs.meta b/Assets/Scripts/Utilities/Timer.cs.meta similarity index 100% rename from Assets/Scripts/Timer.cs.meta rename to Assets/Scripts/Utilities/Timer.cs.meta diff --git a/Task/BugList.txt b/Task/BugList.txt index c46aa92..14fa1ce 100644 --- a/Task/BugList.txt +++ b/Task/BugList.txt @@ -1,5 +1,4 @@ Bug Unity Général : - Bug Mouvement Joycon : Vitesse et mass a modifier : Déplacement trop rapide. Direction ne suit pas la camera -> Incapable de tourner diff --git a/Task/TODOS.txt b/Task/TODOS.txt index 924574b..efe1940 100644 --- a/Task/TODOS.txt +++ b/Task/TODOS.txt @@ -6,18 +6,20 @@ - [Easy-Medium] Outputer le temps - On doit sauvegarder le temps de chaque niveau. + - Enregistrer le nom du joueur et le nom du mouvmenet - Format de la sauvegarde : - Nom du mouvement - Nom du joueur - Temps d'exécution + Nom du mouvement - Nom du joueur - Stage - Temps d'exécution - - [Easy-Medium] Faire le questionnaire de préférence de mouvement - - - [Easy] Randomizer - - Randomize l'emplacement des Démons pour TShapeCorridor (soit à droite, soit à gauche. Pas les deux en même temps) + - [Easy-Medium] Faire le questionnaire + - de préférence de mouvement + - de niveau de confort - [INSANE LEVEL] Trouver du monde pour essayer notre expérience - [Expert Level] Rapport + - [Medium-High Level] Sauvegarder position des utilisateurs + Fixed, mais à valider - [Urgent]Correct le movement WASD, Live il est pire 😋 -ajuster graviter et masse pour ne plus voler @@ -34,4 +36,7 @@ Fixed, mais à valider - [Easy Level] Main Menu ---- Changement de scene et choisir le mode de de controle - Changement de scene est facile à trouver comme TUTO - PlayerPrefs pour garder en mémoire le mode de controle! - - on start. on load le bon selon le playerpref \ No newline at end of file + - on start. on load le bon selon le playerpref + + - [Easy] Randomizer + - Randomize l'emplacement des Démons pour TShapeCorridor (soit à droite, soit à gauche. Pas les deux en même temps) \ No newline at end of file diff --git a/UserSettings/EditorUserSettings.asset b/UserSettings/EditorUserSettings.asset index 5ea9cc9..be6ca54 100644 --- a/UserSettings/EditorUserSettings.asset +++ b/UserSettings/EditorUserSettings.asset @@ -18,17 +18,17 @@ EditorUserSettings: value: 22424703114646680e0b0227036c7b11001e1c1a20293f373f26083de6ae2136ebf32f flags: 0 RecentlyUsedScenePath-4: - value: 22424703114646680e0b0227036c731500121465181b2e313d2c3e3cf0f23d3cedf578fce9332b25 - flags: 0 - RecentlyUsedScenePath-5: value: 22424703114646680e0b0227036c7315001214651f3c34312a210910edf22631e6e824a7f234362820 flags: 0 - RecentlyUsedScenePath-6: + RecentlyUsedScenePath-5: value: 22424703114646680e0b0227036c7315001214651f1b2e313d2c3e3cf0f23d3cedf578fce9332b25 flags: 0 - RecentlyUsedScenePath-7: + RecentlyUsedScenePath-6: value: 22424703114646680e0b0227036c731500121465032a35242c2a1136cbee1931e6e33aeca92f31352d1b flags: 0 + RecentlyUsedScenePath-7: + value: 22424703114646680e0b0227036c731500121465181b2e313d2c3e3cf0f23d3cedf578fce9332b25 + flags: 0 RecentlyUsedScenePath-8: value: 22424703114646680e0b0227036c73150012146501293c35633c133af6f9 flags: 0