From 6c11a27e463348801298efee3e594e9447a6cb15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Gervais?= Date: Fri, 8 Apr 2016 18:50:26 -0400 Subject: [PATCH] =?UTF-8?q?corrections=20de=20bogues=20d'int=C3=A9gration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Asteroid.cs | 12 ++++++------ Assets/Scripts/Astronaut.cs | 10 +++++----- Assets/Scripts/AstronautController.cs | 4 ++-- Assets/Scripts/Earthquake.cs | 14 +++++++------- Assets/Scripts/PlanetManager.cs | 19 ++++++++++--------- Assets/Scripts/testRotate.cs | 16 ++++++++-------- 6 files changed, 38 insertions(+), 37 deletions(-) diff --git a/Assets/Scripts/Asteroid.cs b/Assets/Scripts/Asteroid.cs index 56875e8..b3dc4bf 100644 --- a/Assets/Scripts/Asteroid.cs +++ b/Assets/Scripts/Asteroid.cs @@ -7,21 +7,21 @@ public class Asteroid : MonoBehaviour public float speed; public float step; - // Use this for initialization - void Start() + // Use this for initialization + public void Start() { speed = Random.Range(0.9F, 3F); // print(speed); center = new Vector3(0, 0); } - - // Update is called once per frame - void Update () { + + // Update is called once per frame + public void Update () { MoveObject(center); } - void MoveObject(Vector3 center) + public void MoveObject(Vector3 center) { step = speed * Time.deltaTime; this.transform.position = Vector3.MoveTowards(transform.position, center, step); diff --git a/Assets/Scripts/Astronaut.cs b/Assets/Scripts/Astronaut.cs index e37c886..943fcf7 100644 --- a/Assets/Scripts/Astronaut.cs +++ b/Assets/Scripts/Astronaut.cs @@ -62,8 +62,8 @@ public class Astronaut : MonoBehaviour { private float walkTime = 0; private int nextStep = 1; - // Use this for initialization - void Start () { + // Use this for initialization + public void Start () { if (!planet) { planet = FindObjectOfType(); @@ -103,9 +103,9 @@ public class Astronaut : MonoBehaviour { { return Mathf.Repeat(num + limit, limit); } - - // Update is called once per frame - void Update () { + + // Update is called once per frame + public void Update () { float delta = Time.deltaTime; if (!grounded) diff --git a/Assets/Scripts/AstronautController.cs b/Assets/Scripts/AstronautController.cs index ecd56b0..c830cde 100644 --- a/Assets/Scripts/AstronautController.cs +++ b/Assets/Scripts/AstronautController.cs @@ -9,8 +9,8 @@ public class AstronautController : MonoBehaviour { public int PlayerNumber; - // Use this for initialization - void Start() + // Use this for initialization + public void Start() { InputManager.Instance.PushActiveContext("Gameplay", PlayerNumber); InputManager.Instance.AddCallback(PlayerNumber, HandlePlayerAxis); diff --git a/Assets/Scripts/Earthquake.cs b/Assets/Scripts/Earthquake.cs index 58a3558..8e6c355 100644 --- a/Assets/Scripts/Earthquake.cs +++ b/Assets/Scripts/Earthquake.cs @@ -6,33 +6,33 @@ public class Earthquake : MonoBehaviour { const int gaugeMax=100; // Use this for initialization - void Start() + public void Start() { gaugeLevel = 0; InvokeRepeating("FillGauge", 1, 1F); } - - // Update is called once per frame - void Update () { + + // Update is called once per frame + public void Update () { } /// /// Actualiser l'affichage de la gauge /// - void UpdateFixed() + public void UpdateFixed() { } - + /// /// à être Appelé à chaque fois qu'on enfonce un plateau, le gage se remplis plus vite. (et par le temps) /// - void FillGauge() + public void FillGauge() { if (gaugeLevel < gaugeMax) { diff --git a/Assets/Scripts/PlanetManager.cs b/Assets/Scripts/PlanetManager.cs index ad5f38e..d1dc94f 100644 --- a/Assets/Scripts/PlanetManager.cs +++ b/Assets/Scripts/PlanetManager.cs @@ -10,6 +10,7 @@ public class PlanetManager : MonoBehaviour public float TailleCartiersEnDegres = 0; //radian -> valeurs 0 a 360 public float CartierResetRatioSpeedFactor = 0.23f; //Entre 0.05 et 1 ou plus on aime que ca restore lentement, randomnly public bool CartierResetRatioSpeedRandomize = true; + public bool CartierResetOverTime = true; public float CartierMinRatio = 0.4f; public float CartierMaxRatio = 2.0f; public float CartierStepSize = 0.25f; @@ -17,7 +18,7 @@ public class PlanetManager : MonoBehaviour public List wedges = new List(); // Use this for initialization - void Awake () { + public void Awake () { TailleCartiersEnDegres = 360.0f / NbCartiers; for(int i = 0; i < NbCartiers; i++) @@ -34,17 +35,17 @@ public class PlanetManager : MonoBehaviour w.sprite = GameObject.Find(obj.name); wedges.Add(w); //pushes at end. } - } - - // Update is called once per frame - void Update () { + } + + // Update is called once per frame + public void Update () { } - void FixedUpdate() + public void FixedUpdate() { - if (!this.CartierResetRatioSpeedRandomize) return; + if (!this.CartierResetOverTime) return; //Ramener les plateforme vers leur position initiale 0; foreach (var w in wedges) @@ -88,7 +89,7 @@ public class PlanetManager : MonoBehaviour w.offset = w.offset - CartierStepSize; if (w.offset < CartierMinRatio) - w.offset = 0.5f; + w.offset = CartierMinRatio; w.sprite.transform.localScale = new Vector3(w.offset, w.offset, 1); @@ -99,7 +100,7 @@ public class PlanetManager : MonoBehaviour v.offset = v.offset + CartierStepSize; if (v.offset > CartierMaxRatio) - v.offset = 1.5f; + v.offset = CartierMaxRatio; v.sprite.transform.localScale = new Vector3(v.offset, v.offset, 1); } diff --git a/Assets/Scripts/testRotate.cs b/Assets/Scripts/testRotate.cs index 6c00436..f4d7316 100644 --- a/Assets/Scripts/testRotate.cs +++ b/Assets/Scripts/testRotate.cs @@ -9,7 +9,7 @@ public class testRotate : MonoBehaviour { private float speed = 33.2f; public bool check; - void Update() + public void Update() { if(Input.GetKeyDown("space") || Input.GetKey("s")) { @@ -41,18 +41,18 @@ public class testRotate : MonoBehaviour { // Use this for initialization void Start () { - } - - - - - + } + + + + + /// /// Juste pour tester le mouvement du player autour du cercle. /// Le player se déplace de gauche a droite en x et la valeur de x représente l'angle theta /// saute en y /// - void FixedUpdate() + public void FixedUpdate() { var theta = Time.realtimeSinceStartup * speed % 360.0f; // Position X du player = angle theta