From b87d8e17d1cc5183fbc9e7b9299465e80d470441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Gervais?= Date: Sat, 9 Apr 2016 11:46:09 -0400 Subject: [PATCH] =?UTF-8?q?Temps=20avant=20que=20la=20plateforme=20opos?= =?UTF-8?q?=C3=A9e=20redescende=20d'elle=20m=C3=AAme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/PlanetManager.cs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/PlanetManager.cs b/Assets/Scripts/PlanetManager.cs index adc4b2b..65e7cf1 100644 --- a/Assets/Scripts/PlanetManager.cs +++ b/Assets/Scripts/PlanetManager.cs @@ -82,7 +82,7 @@ public class PlanetManager : MonoBehaviour { w.offset = 1.0f; } - else if (w.offset > 1.0f && Time.time >= w.timeSincePushedToMaximum + CartierWaitBeforeRaise) + else if (w.offset > 1.0f && Time.time >= w.timeSinceLastPushedBack + CartierWaitBeforeRaise) { if (!CartierResetRatioSpeedRandomize) { @@ -136,13 +136,15 @@ public class PlanetManager : MonoBehaviour var v = wedges[indexOppose]; // if (Time.time >= v.timeSincePushedToMinimum + CartierWaitBeforeRaise) // résultats étranges ;) - if (wOffsetBefore >= 0.9f) - { + // if (wOffsetBefore >= 0.9f) + // { + if (v.offset < CartierMaxRatio) v.timeSinceLastPushedBack = Time.time; + v.offset = v.offset + difference; //CartierStepSize; //diférentiel au lieu du step size if (v.offset >= CartierMaxRatio) { v.offset = CartierMaxRatio; - w.timeSincePushedToMaximum = Time.time; + //checker si on éjecte des players var players = FindObjectsOfType(); @@ -155,7 +157,7 @@ public class PlanetManager : MonoBehaviour } } v.sprite.transform.localScale = new Vector3(v.offset, v.offset, 1); - } + // } @@ -304,7 +306,7 @@ public class PlanetManager : MonoBehaviour public float tMin = 0; //theta min et theta max : angle thetat de début et fin du cartier; public float tMax = 0; public float timeSincePushedToMinimum = 0.0f; - public float timeSincePushedToMaximum = 0.0f; + public float timeSinceLastPushedBack = 0.0f; public GameObject sprite; //sprite et collider 2D public GameObject gameObject; //wedge prefab avec collider }