corrections de bogues d'intégration

This commit is contained in:
Jean-Sébastien Gervais 2016-04-08 18:50:26 -04:00
parent 4d6094b40f
commit 6c11a27e46
6 changed files with 38 additions and 37 deletions

View File

@ -8,7 +8,7 @@ public class Asteroid : MonoBehaviour
public float step; public float step;
// Use this for initialization // Use this for initialization
void Start() public void Start()
{ {
speed = Random.Range(0.9F, 3F); speed = Random.Range(0.9F, 3F);
// print(speed); // print(speed);
@ -16,12 +16,12 @@ public class Asteroid : MonoBehaviour
} }
// Update is called once per frame // Update is called once per frame
void Update () { public void Update () {
MoveObject(center); MoveObject(center);
} }
void MoveObject(Vector3 center) public void MoveObject(Vector3 center)
{ {
step = speed * Time.deltaTime; step = speed * Time.deltaTime;
this.transform.position = Vector3.MoveTowards(transform.position, center, step); this.transform.position = Vector3.MoveTowards(transform.position, center, step);

View File

@ -63,7 +63,7 @@ public class Astronaut : MonoBehaviour {
private int nextStep = 1; private int nextStep = 1;
// Use this for initialization // Use this for initialization
void Start () { public void Start () {
if (!planet) if (!planet)
{ {
planet = FindObjectOfType<PlanetManager>(); planet = FindObjectOfType<PlanetManager>();
@ -105,7 +105,7 @@ public class Astronaut : MonoBehaviour {
} }
// Update is called once per frame // Update is called once per frame
void Update () { public void Update () {
float delta = Time.deltaTime; float delta = Time.deltaTime;
if (!grounded) if (!grounded)

View File

@ -10,7 +10,7 @@ public class AstronautController : MonoBehaviour {
public int PlayerNumber; public int PlayerNumber;
// Use this for initialization // Use this for initialization
void Start() public void Start()
{ {
InputManager.Instance.PushActiveContext("Gameplay", PlayerNumber); InputManager.Instance.PushActiveContext("Gameplay", PlayerNumber);
InputManager.Instance.AddCallback(PlayerNumber, HandlePlayerAxis); InputManager.Instance.AddCallback(PlayerNumber, HandlePlayerAxis);

View File

@ -6,7 +6,7 @@ public class Earthquake : MonoBehaviour {
const int gaugeMax=100; const int gaugeMax=100;
// Use this for initialization // Use this for initialization
void Start() public void Start()
{ {
gaugeLevel = 0; gaugeLevel = 0;
InvokeRepeating("FillGauge", 1, 1F); InvokeRepeating("FillGauge", 1, 1F);
@ -14,14 +14,14 @@ public class Earthquake : MonoBehaviour {
} }
// Update is called once per frame // Update is called once per frame
void Update () { public void Update () {
} }
/// <summary> /// <summary>
/// Actualiser l'affichage de la gauge /// Actualiser l'affichage de la gauge
/// </summary> /// </summary>
void UpdateFixed() public void UpdateFixed()
{ {
@ -32,7 +32,7 @@ public class Earthquake : MonoBehaviour {
/// <summary> /// <summary>
/// à être Appelé à chaque fois qu'on enfonce un plateau, le gage se remplis plus vite. (et par le temps) /// à être Appelé à chaque fois qu'on enfonce un plateau, le gage se remplis plus vite. (et par le temps)
/// </summary> /// </summary>
void FillGauge() public void FillGauge()
{ {
if (gaugeLevel < gaugeMax) if (gaugeLevel < gaugeMax)
{ {

View File

@ -10,6 +10,7 @@ public class PlanetManager : MonoBehaviour
public float TailleCartiersEnDegres = 0; //radian -> valeurs 0 a 360 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 float CartierResetRatioSpeedFactor = 0.23f; //Entre 0.05 et 1 ou plus on aime que ca restore lentement, randomnly
public bool CartierResetRatioSpeedRandomize = true; public bool CartierResetRatioSpeedRandomize = true;
public bool CartierResetOverTime = true;
public float CartierMinRatio = 0.4f; public float CartierMinRatio = 0.4f;
public float CartierMaxRatio = 2.0f; public float CartierMaxRatio = 2.0f;
public float CartierStepSize = 0.25f; public float CartierStepSize = 0.25f;
@ -17,7 +18,7 @@ public class PlanetManager : MonoBehaviour
public List<Wedge> wedges = new List<Wedge>(); public List<Wedge> wedges = new List<Wedge>();
// Use this for initialization // Use this for initialization
void Awake () { public void Awake () {
TailleCartiersEnDegres = 360.0f / NbCartiers; TailleCartiersEnDegres = 360.0f / NbCartiers;
for(int i = 0; i < NbCartiers; i++) for(int i = 0; i < NbCartiers; i++)
@ -37,14 +38,14 @@ public class PlanetManager : MonoBehaviour
} }
// Update is called once per frame // Update is called once per frame
void Update () { public void Update () {
} }
void FixedUpdate() public void FixedUpdate()
{ {
if (!this.CartierResetRatioSpeedRandomize) return; if (!this.CartierResetOverTime) return;
//Ramener les plateforme vers leur position initiale 0; //Ramener les plateforme vers leur position initiale 0;
foreach (var w in wedges) foreach (var w in wedges)
@ -88,7 +89,7 @@ public class PlanetManager : MonoBehaviour
w.offset = w.offset - CartierStepSize; w.offset = w.offset - CartierStepSize;
if (w.offset < CartierMinRatio) if (w.offset < CartierMinRatio)
w.offset = 0.5f; w.offset = CartierMinRatio;
w.sprite.transform.localScale = new Vector3(w.offset, w.offset, 1); w.sprite.transform.localScale = new Vector3(w.offset, w.offset, 1);
@ -99,7 +100,7 @@ public class PlanetManager : MonoBehaviour
v.offset = v.offset + CartierStepSize; v.offset = v.offset + CartierStepSize;
if (v.offset > CartierMaxRatio) if (v.offset > CartierMaxRatio)
v.offset = 1.5f; v.offset = CartierMaxRatio;
v.sprite.transform.localScale = new Vector3(v.offset, v.offset, 1); v.sprite.transform.localScale = new Vector3(v.offset, v.offset, 1);
} }

View File

@ -9,7 +9,7 @@ public class testRotate : MonoBehaviour {
private float speed = 33.2f; private float speed = 33.2f;
public bool check; public bool check;
void Update() public void Update()
{ {
if(Input.GetKeyDown("space") || Input.GetKey("s")) if(Input.GetKeyDown("space") || Input.GetKey("s"))
{ {
@ -52,7 +52,7 @@ public class testRotate : MonoBehaviour {
/// Le player se déplace de gauche a droite en x et la valeur de x représente l'angle theta /// Le player se déplace de gauche a droite en x et la valeur de x représente l'angle theta
/// saute en y /// saute en y
/// </summary> /// </summary>
void FixedUpdate() public void FixedUpdate()
{ {
var theta = Time.realtimeSinceStartup * speed % 360.0f; // Position X du player = angle theta var theta = Time.realtimeSinceStartup * speed % 360.0f; // Position X du player = angle theta