diff --git a/T3-Unity/Assets/Scripts/GameManager.cs b/T3-Unity/Assets/Scripts/GameManager.cs index 3632547fbeea553bee15a3c151b967aa1bdb9298..64da76e9511dbfd8f6ff26836b1d286e7d2493eb 100644 --- a/T3-Unity/Assets/Scripts/GameManager.cs +++ b/T3-Unity/Assets/Scripts/GameManager.cs @@ -1,6 +1,7 @@ namespace Scripts { using UnityEngine; + using UnityEngine.EventSystems; using Mapbox.Unity.Map; using Scripts.Map; using Scripts.Routes; @@ -38,8 +39,17 @@ namespace Scripts //! La variable @a indexWaypoint sert à récupérer le préfabriquée voulu dans waypoints et pour noter à quel étape de création est le joueur. void Update() { + + + if (Input.GetKeyDown(KeyCode.Mouse0) && _locked && _indexWaypoint < 2) { + + if (EventSystem.current.IsPointerOverGameObject()) + { + return; + } + Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); float enter = 0.0f; diff --git a/T3-Unity/Assets/Scripts/IA/RunnersFactory.cs b/T3-Unity/Assets/Scripts/IA/RunnersFactory.cs index a3f543060a1db727833afa55ea6e9b06ae3857a0..ff3de5e323e650afd056bb023d0c04dfc7a9d2f8 100644 --- a/T3-Unity/Assets/Scripts/IA/RunnersFactory.cs +++ b/T3-Unity/Assets/Scripts/IA/RunnersFactory.cs @@ -35,5 +35,6 @@ { return instance; } + } } \ No newline at end of file diff --git a/T3-Unity/Assets/Scripts/Routes/RouteTracer.cs b/T3-Unity/Assets/Scripts/Routes/RouteTracer.cs index 936e0a2b69081fddc41bf4e082986318f01047a3..be11bad239ada7b0f42a3ca2e92cf75c24367b1b 100644 --- a/T3-Unity/Assets/Scripts/Routes/RouteTracer.cs +++ b/T3-Unity/Assets/Scripts/Routes/RouteTracer.cs @@ -63,10 +63,7 @@ DrawLine(_startObject.transform.position, _finishObject.transform.position, Color.cyan, 1f); } - while(Ui.start == false) - { - - } + GameObject.Find("Player").transform.position = new Vector3( diff --git a/T3-Unity/Assets/Scripts/UI/ValidateGame.cs b/T3-Unity/Assets/Scripts/UI/ValidateGame.cs index 94e2fcb4f7178ad984c351e07db697b6634e2172..2cacaf6321c5f418ebdf3f5ac71dccdb3bc7b2f9 100644 --- a/T3-Unity/Assets/Scripts/UI/ValidateGame.cs +++ b/T3-Unity/Assets/Scripts/UI/ValidateGame.cs @@ -37,6 +37,8 @@ Ui.stop = true; + Ui.start = false; + } diff --git a/T3-Unity/Assets/test.json b/T3-Unity/Assets/test.json index f018d0bcc052070f51d0bdff831d6035e5fac65c..cb14f22f0d5dbfa6a3e8bacbd91b95ac0fa6bb04 100644 --- a/T3-Unity/Assets/test.json +++ b/T3-Unity/Assets/test.json @@ -12,33 +12,13 @@ true ], "bearings": [ - 260 + 252 ], "location": [ - 7.743328, - 48.571094 + 7.745167, + 48.571364 ] - } - ], - "geometry": "ipmgHyjgn@@T@D?HAL?JCN", - "maneuver": { - "bearing_after": 260, - "type": "depart", - "modifier": null, - "bearing_before": 0, - "Location": [ - 7.743328, - 48.571094 - ], - "instruction": "Drive west on Petit Heyritz." - }, - "duration": 4.279, - "distance": 29.712, - "name": "Petit Heyritz", - "mode": "driving" - }, - { - "intersections": [ + }, { "out": 1, "entry": [ @@ -46,12 +26,12 @@ true ], "bearings": [ - 101, - 216 + 72, + 254 ], "location": [ - 7.742935, - 48.571097 + 7.744899, + 48.571307 ], "in": 0 }, @@ -62,7 +42,7 @@ true ], "bearings": [ - 36, + 79, 260 ], "location": [ @@ -88,20 +68,20 @@ "in": 0 } ], - "geometry": "kpmgHihgn@\\^Dl@Dx@BfA@dB?dB@b@@ZAzBAXAPERKVuApD", + "geometry": "_rmgHivgn@Ht@d@fEJ`ADj@Hz@Dv@Dl@Dx@BfA@dB?dB@b@@ZAzBAXAPERKVuApD", "maneuver": { - "bearing_after": 260, - "type": "turn", - "modifier": "slight left", - "bearing_before": 281, + "bearing_after": 252, + "type": "depart", + "modifier": null, + "bearing_before": 0, "Location": [ - 7.742935, - 48.571097 + 7.745167, + 48.571364 ], - "instruction": "Bear left onto Rue de la Corderie." + "instruction": "Drive west on Rue de la Corderie." }, - "duration": 29.706, - "distance": 347.0, + "duration": 40.337, + "distance": 509.439, "name": "Rue de la Corderie", "mode": "driving" }, @@ -966,38 +946,58 @@ 48.572458 ], "in": 1 - }, + } + ], + "geometry": "kxmgHeckn@J?DBDHBF@N@PAJCFCHGHKDQBE?G?", + "maneuver": { + "bearing_after": 324, + "type": "continue", + "modifier": "uturn", + "bearing_before": 157, + "Location": [ + 7.762593, + 48.572375 + ], + "instruction": "Make a right U-turn." + }, + "duration": 16.48, + "distance": 75.0, + "name": "", + "mode": "driving" + }, + { + "intersections": [ { - "out": 0, + "out": 1, "entry": [ - true, - false + false, + true ], "bearings": [ - 2, - 180 + 180, + 338 ], "location": [ 7.762057, 48.572531 ], - "in": 1 + "in": 0 } ], - "geometry": "kxmgHeckn@J?DBDHBF@N@PAJCFCHGHKDQBE?G?gAA", + "geometry": "iymgH{_kn@UJILCHGPEPMlA", "maneuver": { - "bearing_after": 324, - "type": "continue", - "modifier": "uturn", - "bearing_before": 157, + "bearing_after": 338, + "type": "turn", + "modifier": "slight left", + "bearing_before": 0, "Location": [ - 7.762593, - 48.572375 + 7.762057, + 48.572531 ], - "instruction": "Make a right U-turn." + "instruction": "Bear left toward P 1 Centre commercial." }, - "duration": 32.487, - "distance": 115.0, + "duration": 12.685, + "distance": 69.933, "name": "", "mode": "driving" }, @@ -1009,24 +1009,24 @@ true ], "bearings": [ - 182 + 105 ], "location": [ - 7.762072, - 48.57289 + 7.761308, + 48.572845 ], "in": 0 } ], - "geometry": "q{mgH}_kn@??", + "geometry": "i{mgHe{jn@??", "maneuver": { "bearing_after": 0, "type": "arrive", "modifier": null, - "bearing_before": 2, + "bearing_before": 285, "Location": [ - 7.762072, - 48.57289 + 7.761308, + 48.572845 ], "instruction": "You have arrived at your destination." }, @@ -1037,31 +1037,31 @@ } ], "summary": "M 1004, Avenue du Rhin", - "duration": 395.496, - "distance": 2703.71, + "duration": 398.526, + "distance": 2866.371, "annotation": null } ], - "geometry": "ipmgHyjgn@AnAh@fCDhNiBnFDlBpDVZo@g@_XyDo_@iBw\\x@qWkGfBYy@zA_T\\oSb@W\\d@Ox@sBF", - "duration": 395.496, - "distance": 2703.71, - "weight": 628.381, + "geometry": "_rmgHivgn@vAlONlKEfDgB|EDlBpDVZo@g@_XyDo_@iBw\\x@qWkGfBYy@zA_T\\oSb@W\\bA{@d@_AtC", + "duration": 398.526, + "distance": 2866.371, + "weight": 623.91, "weight_name": "auto" } ], "waypoints": [ { - "name": "Petit Heyritz", + "name": "Rue de la Corderie", "location": [ - 7.743328, - 48.571094 + 7.745167, + 48.571364 ] }, { "name": "", "location": [ - 7.762072, - 48.57289 + 7.761308, + 48.572845 ] } ],