diff --git a/Assets/Prefabs/file.txt.meta b/Assets/Prefabs/file.txt.meta new file mode 100644 index 0000000..5db0151 --- /dev/null +++ b/Assets/Prefabs/file.txt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: afc3ba2bd5b70194e9fb05d80712eecb +timeCreated: 1460091048 +licenseType: Pro +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/PlanetManager.cs b/Assets/Scripts/PlanetManager.cs index a62a2a4..155c11b 100644 --- a/Assets/Scripts/PlanetManager.cs +++ b/Assets/Scripts/PlanetManager.cs @@ -1,5 +1,7 @@ -using UnityEngine; +using System; +using UnityEngine; using System.Collections; +using System.Collections.Generic; public class PlanetManager : MonoBehaviour { @@ -7,19 +9,17 @@ public class PlanetManager : MonoBehaviour public int NbCartiers = 10; public float TailleCartiersEnDegres = 0; //radian -> valeurs 0 a 360 - var wedges = new List(); + public List wedges = new List(); // Use this for initialization void Start () { - TailleCartiersEnRadiants = 360.0 / NbCartiers; - - float debutAngleTheta = 0.0; - + TailleCartiersEnDegres = 360.0f / NbCartiers; + for(int i = 0; i < NbCartiers; i++) { - debutAngleTheta = i*TailleCartiersEnRadiants; - wedges.Add(new wedges(){tMin = debutAngleTheta, tMax = debutAngleTheta + TailleCartiersEnRadiants}); + float debutAngleTheta = i* TailleCartiersEnDegres; + wedges.Add(new Wedge(){tMin = debutAngleTheta, tMax = debutAngleTheta + TailleCartiersEnDegres }); } } @@ -33,18 +33,17 @@ public class PlanetManager : MonoBehaviour public float GetPlanetRadius() { - + return 5.0f; } public Vector3 GetPlanetCoordinatesFromPlayerXY(float playerLocalX, float playerLocalY) { var theta = playerLocalX; - double x = r * Math.Cos(theta * Math.PI / 180); - double y = r * Math.Sin(theta * Math.PI / 180) + playerLocalY; + var x = GetPlanetRadius() * Math.Cos(theta * Math.PI / 180); + var y = GetPlanetRadius() * Math.Sin(theta * Math.PI / 180) + playerLocalY; - - return new Vector3(x,y,0); + return new Vector3((float)x, (float)y, 0); } @@ -54,7 +53,7 @@ public class PlanetManager : MonoBehaviour /// public int GetWedgeIndex(float thetaPlayerX) { - return Math.Floor(thetaPlayerX / TailleCartiersEnRadiants); + return (int)Math.Floor(thetaPlayerX / TailleCartiersEnDegres); } /// @@ -84,9 +83,9 @@ public class PlanetManager : MonoBehaviour /// public class Wedge { - float yoffset = 0; //valeurs entre -1 et 1; -1 étant renfoncé, 0 position normale, et 1 vers l'extérieur - float tMin = 0; //theta min et theta max : angle thetat de début et fin du cartier; - float tMax = 0; + public float yoffset = 0; //valeurs entre -1 et 1; -1 étant renfoncé, 0 position normale, et 1 vers l'extérieur + public float tMin = 0; //theta min et theta max : angle thetat de début et fin du cartier; + public float tMax = 0; } diff --git a/Assets/Scripts/PlanetManager.cs.meta b/Assets/Scripts/PlanetManager.cs.meta new file mode 100644 index 0000000..a796795 --- /dev/null +++ b/Assets/Scripts/PlanetManager.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 43d953650863ce04d8918939e0248654 +timeCreated: 1460091046 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/file.txt.meta b/Assets/Scripts/file.txt.meta new file mode 100644 index 0000000..1390611 --- /dev/null +++ b/Assets/Scripts/file.txt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6681384214c3a3e4a90c112542387b03 +timeCreated: 1460091047 +licenseType: Pro +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/testRotate.cs.meta b/Assets/Scripts/testRotate.cs.meta new file mode 100644 index 0000000..0cd53ad --- /dev/null +++ b/Assets/Scripts/testRotate.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: ac56b6226ed50a742a676cbfae403f88 +timeCreated: 1460091047 +licenseType: Pro +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Sounds/file.txt.meta b/Assets/Sounds/file.txt.meta new file mode 100644 index 0000000..2fb6a85 --- /dev/null +++ b/Assets/Sounds/file.txt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6b2a8ad68d415d446ac7ecf9db5491bc +timeCreated: 1460091047 +licenseType: Pro +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Scenes/file.txt.meta b/Assets/_Scenes/file.txt.meta new file mode 100644 index 0000000..cecd3cf --- /dev/null +++ b/Assets/_Scenes/file.txt.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6e82e3d7221e4604f8b5b5ce23f8eccb +timeCreated: 1460091048 +licenseType: Pro +TextScriptImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/_Scenes/planet.unity.meta b/Assets/_Scenes/planet.unity.meta new file mode 100644 index 0000000..9d5ff4f --- /dev/null +++ b/Assets/_Scenes/planet.unity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c5f60472012ea55409d7eb4b1ecaec89 +timeCreated: 1460091041 +licenseType: Pro +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 01791a2..92dfed6 100644 Binary files a/ProjectSettings/ProjectSettings.asset and b/ProjectSettings/ProjectSettings.asset differ