diff --git a/T3-Unity/Assets/Scripts/Button UI/ExitScene.cs b/T3-Unity/Assets/Scripts/Button UI/ExitScene.cs index 8592fe0b9fc6981536d5fc3637e070d11f3fab84..50c23fb6688fcb47f42c2b08d94d04ab74931bfb 100644 --- a/T3-Unity/Assets/Scripts/Button UI/ExitScene.cs +++ b/T3-Unity/Assets/Scripts/Button UI/ExitScene.cs @@ -1,12 +1,13 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class ExitScene : MonoBehaviour +namespace Scripts.ButtonUI { - // Start is called before the first frame update - public void Exit() - { - Application.Quit(); - } -} + using UnityEngine; + + public class ExitScene : MonoBehaviour + { + // Start is called before the first frame update + public void Exit() + { + Application.Quit(); + } + } +} \ No newline at end of file diff --git a/T3-Unity/Assets/Scripts/GameManager.cs b/T3-Unity/Assets/Scripts/GameManager.cs index d56d09944ee72d7ca2f6d6bcf6ebfb24949ab84a..beaae6154876e2fa98b2ba08d679ea843164607b 100644 --- a/T3-Unity/Assets/Scripts/GameManager.cs +++ b/T3-Unity/Assets/Scripts/GameManager.cs @@ -4,7 +4,6 @@ namespace Scripts using UnityEngine.EventSystems; using Mapbox.Unity.Map; using Scripts.Map; - using Scripts.Routes; using Scripts.Waypoints; //! @authors MrWarzo @@ -55,7 +54,7 @@ namespace Scripts float enter = 0.0f; if (_yPlane.Raycast(ray, out enter)) { - Instantiate(waypoints[_indexWaypoint], ray.GetPoint(enter) + Vector3.up, new Quaternion(0, 0, 0, 0), WaypointsFactory.getInstance()._prefabs_parent); + Instantiate(waypoints[_indexWaypoint], ray.GetPoint(enter) + Vector3.up, new Quaternion(0, 0, 0, 0), WaypointsFactory.getInstance().prefabs_parent); switch (_indexWaypoint) { diff --git a/T3-Unity/Assets/Scripts/MapBox/ForwardGeocodeUserInput.cs b/T3-Unity/Assets/Scripts/MapBox/ForwardGeocodeUserInput.cs index e98c87c6decf07fd25e2d9be63a3aafd1e06f18e..0a06e17f62ced478d234f199d676380aefd8ef3a 100644 --- a/T3-Unity/Assets/Scripts/MapBox/ForwardGeocodeUserInput.cs +++ b/T3-Unity/Assets/Scripts/MapBox/ForwardGeocodeUserInput.cs @@ -7,6 +7,8 @@ using Mapbox.Geocoding; using Mapbox.Utils; + //! @author MapBox + //! @brief Traduit des coordonnée unity en coordonnée GPS [RequireComponent(typeof(InputField))] public class ForwardGeocodeUserInput : MonoBehaviour { diff --git a/T3-Unity/Assets/Scripts/MapBox/HeroBuildingSelectionUserInput.cs b/T3-Unity/Assets/Scripts/MapBox/HeroBuildingSelectionUserInput.cs index 50e7b73094bdb9721b61c5358144949618811b42..fdd025beb43ae1caab3877ffa678b808c744f7ea 100644 --- a/T3-Unity/Assets/Scripts/MapBox/HeroBuildingSelectionUserInput.cs +++ b/T3-Unity/Assets/Scripts/MapBox/HeroBuildingSelectionUserInput.cs @@ -6,83 +6,83 @@ namespace Scripts.MapBox { - using Mapbox.Unity; - using UnityEngine; - using UnityEngine.UI; - using System; - using Mapbox.Geocoding; - using Mapbox.Utils; - using Mapbox.Unity.Location; - using Mapbox.Unity.Utilities; - - public class HeroBuildingSelectionUserInput : MonoBehaviour - { - - [Geocode] - public string location; - - [SerializeField] - private Vector3 _cameraPosition; - [SerializeField] - private Vector3 _cameraRotation; - - private Camera _camera; - - Button _button; - - ForwardGeocodeResource _resource; - - bool _hasResponse; - public bool HasResponse - { - get - { - return _hasResponse; - } - } - - public ForwardGeocodeResponse Response { get; private set; } - - public event Action<ForwardGeocodeResponse, bool> OnGeocoderResponse = delegate { }; - - void Awake() - { - _button = GetComponent<Button>(); - _button.onClick.AddListener(HandleUserInput); - _resource = new ForwardGeocodeResource(""); - _camera = Camera.main; - } - - void TransformCamera() - { - _camera.transform.position = _cameraPosition; - _camera.transform.localEulerAngles = _cameraRotation; - } - - void HandleUserInput() - { - _hasResponse = false; - if (!string.IsNullOrEmpty(location)) - { - _resource.Query = location; - MapboxAccess.Instance.Geocoder.Geocode(_resource, HandleGeocoderResponse); - - } - } - - void HandleGeocoderResponse(ForwardGeocodeResponse res) - { - _hasResponse = true; - Response = res; - TransformCamera(); - OnGeocoderResponse(res, false); - } - - public void BakeCameraTransform() - { - _cameraPosition = _camera.transform.position; - _cameraRotation = _camera.transform.localEulerAngles; - } - - } + using Mapbox.Unity; + using UnityEngine; + using UnityEngine.UI; + using System; + using Mapbox.Geocoding; + using Mapbox.Unity.Utilities; + + //! @author MapBox + //! @brief Traduit des coordonnée unity en coordonnée GPS + public class HeroBuildingSelectionUserInput : MonoBehaviour + { + + [Geocode] + public string location; + + [SerializeField] + private Vector3 _cameraPosition; + [SerializeField] + private Vector3 _cameraRotation; + + private Camera _camera; + + Button _button; + + ForwardGeocodeResource _resource; + + bool _hasResponse; + public bool HasResponse + { + get + { + return _hasResponse; + } + } + + public ForwardGeocodeResponse Response { get; private set; } + + public event Action<ForwardGeocodeResponse, bool> OnGeocoderResponse = delegate { }; + + void Awake() + { + _button = GetComponent<Button>(); + _button.onClick.AddListener(HandleUserInput); + _resource = new ForwardGeocodeResource(""); + _camera = Camera.main; + } + + void TransformCamera() + { + _camera.transform.position = _cameraPosition; + _camera.transform.localEulerAngles = _cameraRotation; + } + + void HandleUserInput() + { + _hasResponse = false; + if (!string.IsNullOrEmpty(location)) + { + _resource.Query = location; + MapboxAccess.Instance.Geocoder.Geocode(_resource, HandleGeocoderResponse); + + } + } + + void HandleGeocoderResponse(ForwardGeocodeResponse res) + { + _hasResponse = true; + Response = res; + TransformCamera(); + OnGeocoderResponse(res, false); + } + + public void BakeCameraTransform() + { + _cameraPosition = _camera.transform.position; + _cameraRotation = _camera.transform.localEulerAngles; + } + + } } diff --git a/T3-Unity/Assets/Scripts/SaveVariable.cs b/T3-Unity/Assets/Scripts/SaveVariable.cs index 1dbd56a91e985df7fd0db328b548ef87ec45b6bd..285980da9bae34d2b7007e7d0e2b03c84606f207 100644 --- a/T3-Unity/Assets/Scripts/SaveVariable.cs +++ b/T3-Unity/Assets/Scripts/SaveVariable.cs @@ -1,23 +1,27 @@ -using Scripts.UI; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.SceneManagement; - -public class SaveVariable : MonoBehaviour +namespace Scripts { - public static int fame; - public static int nbParty = 0; + using UnityEngine; + using UnityEngine.SceneManagement; - public static void Save() + //! @authors Wakestufou + //! @brief Enregiste les variables nécéssaires + public class SaveVariable : MonoBehaviour { - fame = Ui.fame; - nbParty += 1; - Reload(); - } + public static int fame; //!< Niveau de réputation. + public static int nbParty = 0; //!< Nombre de courses éffectuées. - static void Reload() - { - SceneManager.LoadScene("Map_Tests1"); + //! @brief Sauvegarde les valeurs voulues puis lance @b Reload(). + public static void Save() + { + fame = Ui.fame; + nbParty += 1; + Reload(); + } + + //! @brief Relance la scene. + static void Reload() + { + SceneManager.LoadScene("Map_Tests1"); + } } -} +} \ No newline at end of file