From 07e970554d80e1ae27f7346082a2ffc7306de536 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Gervais?= Date: Fri, 8 Apr 2016 08:11:29 -0400 Subject: [PATCH 1/4] fixed merge --- Assets/Prefabs/WedgePrefab00.prefab | Bin 5716 -> 2568 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/Assets/Prefabs/WedgePrefab00.prefab b/Assets/Prefabs/WedgePrefab00.prefab index 479b5bd9ea25e223beb0b2e34ab7f0b592320a10..f46b5dfdf6c0a33cafc4fa9321285c6484f5d64f 100644 GIT binary patch literal 2568 zcmdT`ZExBz5dO}ua6h!43W`HYfNzYxEK+GJDBY@QLQZ0Wr^H5%>C2}5_nprqO-uKp zX__{KqWEl|FV8*qocC`>lXF5lw6%XdIwO0VJz`ik+(=;_yJ;s;#i8#}I&8JuZ97ZJ z0X^~u-G1wg75p;(#1k`Y5mGGN`&*In)0}1Hka%dm(tOF{E2gvl54?o@tLPLT$e)0AqjB%SQTp}!M_cpO@fAlzz>72Z+Ewe zPyNOWjQsw<@4E=j*(29g$QSTsL-LNN8F$g+Dc3BU87*WsBy$NEWjsZDl-NjKe$oZI zoA7e=%Ne{roL-L5v&-lCtVl>uX zsZxArZDZ98yaJ=XfIEur;0f-wj>apIr%;owWNP+4)l0EBWoBiIqMqDV>r^RosZ&=k zTUoFGW2yZ!0Ha7X;P`!jX=e}~xrB5)FF+KxP@LP;{UXrh!$;)S4y=xuF4Whs1*IYf zm0Y!EYb^|)atR556rjr;>HS+QZh(9uS)B9KN|@~iV^*5kilyql?gUewa1gl{)(HdE z2VE~;Fp+xU5n!Ed1o*@r(0K61yL~+*=5Y;V-=<}@iA!!GnTmwN@feU3-#5%8D+}^2 zt>+~_7um{OX%*XDPN$}PnL~?%%0&CTWSKn&U7}?qla+dPXiKUs$J6D2B@P*So@S0>W-)N-KLr=7S7i;(490{a{sjDL}jzXS#Ev< DJpKwO literal 5716 zcmdT|U2I&%6`s3m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GY zi=JvB3s35*#y3<3jQNR<1HZ}1sl}O=PAXw7sA@B2vajy)lWK!W8xqqkJsQ*-$wVB@ z7?DXm+tm0hi$ViUxBNQuz8MUL)kef`J5voRp;K0rN{dKkreUlh;7 zj*%!HYWQ)oTPH$H0emmUi616=Dj1CgVKBcqZ=|Mzr>SpnF^Q%RjQNLl2QA1|bJ$>5 zM=>%UvnEXVu|E$5af@H5D^Y+`(1_1b^Yv-IT2nwu7v{}@KyWB(VwbV1s~P2EJkksn z4yMoFs83OF9^J5Z)3xjb#z`%(_ps#f@Z0JAl;@@nE;YsS@V<-QJkKp1TypHc((y(<%lPPx z^{hWL7S)2;peo<9$SV2a{@4#&vq(uu74l1Uc)})?~mUON2>zJugw2Q$QG7axR<{CGP0aRKtms-h)MVp&u zYLK>whd4?8^mOn=nL7kL=$ec73c)A97tkeX$htS4levQ+t98w_KO3S7brS!-h36U5 zW!;hbm;IbufLb0L6XK`E^v__KnV4a?+SUwaVn1HKYcULxm5fF9Mgx=tO>#5Nr!e!Z@_ z^%c!*eg&$O)ysLS*ZP>^Ok9qhE&Ry1R9(GvT7BfU=gjx4wRdLkeB)TU<+Fat%gG(; z#$0{woy+9fJ5QhbW@mKuvkwZE>9aDfKZsd7>^z^n^jJAQ*$bN}d8tkOke&&AaAH@l imAo&d;;>OQ7gTl*O%-;qi_c_*wWHU17qjO<`Tqk297%@& From 546bfa405e3a22a11172dc43d9b614acc15ac863 Mon Sep 17 00:00:00 2001 From: Sophie Date: Fri, 8 Apr 2016 08:54:05 -0400 Subject: [PATCH 2/4] started earthquake --- Assets/Scripts/Asteroid.cs | 5 ++++- Assets/Scripts/Astronaut.cs | 17 ++++++++-------- Assets/Scripts/Earthquake.cs | 33 +++++++++++++++++++++++++++++++ Assets/Scripts/Earthquake.cs.meta | 12 +++++++++++ Assets/m_asteroid.mat | 17 ++++++++-------- 5 files changed, 67 insertions(+), 17 deletions(-) create mode 100644 Assets/Scripts/Earthquake.cs create mode 100644 Assets/Scripts/Earthquake.cs.meta diff --git a/Assets/Scripts/Asteroid.cs b/Assets/Scripts/Asteroid.cs index ab18c29..23cb82d 100644 --- a/Assets/Scripts/Asteroid.cs +++ b/Assets/Scripts/Asteroid.cs @@ -8,7 +8,10 @@ public class Asteroid : MonoBehaviour public float step; // Use this for initialization - void Start () { + void Start() + { + speed = Random.Range(0.1F, 2F); + print(speed); center = new Vector3(0, 0); } diff --git a/Assets/Scripts/Astronaut.cs b/Assets/Scripts/Astronaut.cs index 5aa35c7..44e3a47 100644 --- a/Assets/Scripts/Astronaut.cs +++ b/Assets/Scripts/Astronaut.cs @@ -40,10 +40,10 @@ public class Astronaut : MonoBehaviour { SpriteDash.SetActive(false); } - /*if (_state == AstronautState.Walking) + if (_state == AstronautState.Walking) { StartCoroutine(WalkingStance()); - }*/ + } } } @@ -60,8 +60,8 @@ public class Astronaut : MonoBehaviour { // Update is called once per frame void Update () { - - /*if (State == AstronautState.Walking) + /* + if (State == AstronautState.Walking) { walkTime += Time.deltaTime / StepTime; Vector3 rotation = transform.rotation.eulerAngles; @@ -129,14 +129,15 @@ public class Astronaut : MonoBehaviour { Debug.Log("Clicked the button with an image"); } - /*IEnumerator WalkingStance() + IEnumerator WalkingStance() { Debug.Log("walking stance"); walkTime += Time.deltaTime / StepTime; - while (State <= AstronautState.Walking && walkTime <= 1f) + while (State <= AstronautState.Walking || walkTime <= 1f) { Vector3 rotation = transform.rotation.eulerAngles; - rotation.z = Mathf.Sin(walkTime*Mathf.PI); + rotation.z = Mathf.Sin(walkTime*Mathf.PI)*50; + print("rotation " + rotation); transform.rotation = Quaternion.Euler(rotation); yield return null; } @@ -146,5 +147,5 @@ public class Astronaut : MonoBehaviour { { StartCoroutine("WalkingStance"); } - }*/ + } } diff --git a/Assets/Scripts/Earthquake.cs b/Assets/Scripts/Earthquake.cs new file mode 100644 index 0000000..f7943aa --- /dev/null +++ b/Assets/Scripts/Earthquake.cs @@ -0,0 +1,33 @@ +using UnityEngine; +using System.Collections; + +public class Earthquake : MonoBehaviour { + int gaugeLevel; + const int gaugeMax=4; + + // Use this for initialization + void Start() + { + gaugeLevel = 0; + InvokeRepeating("fillGauge", 1, 1F); + + } + + // Update is called once per frame + void Update () { + + } + + void fillGauge() + { + if (gaugeLevel < gaugeMax) + { + gaugeLevel += 1; + } + else + { + gaugeLevel = 0; + } + print("gauge is at: " + gaugeLevel); + } +} diff --git a/Assets/Scripts/Earthquake.cs.meta b/Assets/Scripts/Earthquake.cs.meta new file mode 100644 index 0000000..318d54b --- /dev/null +++ b/Assets/Scripts/Earthquake.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: c11fa6fea03561044843359e6d9d23a6 +timeCreated: 1460117184 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/m_asteroid.mat b/Assets/m_asteroid.mat index 6a10223..7bca657 100644 --- a/Assets/m_asteroid.mat +++ b/Assets/m_asteroid.mat @@ -8,10 +8,11 @@ Material: m_PrefabInternal: {fileID: 0} m_Name: m_asteroid m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} - m_ShaderKeywords: + m_ShaderKeywords: _ALPHAPREMULTIPLY_ON m_LightmapFlags: 5 - m_CustomRenderQueue: -1 - stringTagMap: {} + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent m_SavedProperties: serializedVersion: 2 m_TexEnvs: @@ -86,7 +87,7 @@ Material: data: first: name: _DstBlend - second: 0 + second: 10 data: first: name: _Cutoff @@ -98,7 +99,7 @@ Material: data: first: name: _ZWrite - second: 1 + second: 0 data: first: name: _Glossiness @@ -122,11 +123,11 @@ Material: data: first: name: _Mode - second: 0 + second: 3 data: first: name: _Metallic - second: 0 + second: 0.23 m_Colors: data: first: @@ -135,4 +136,4 @@ Material: data: first: name: _Color - second: {r: 0.3897059, g: 0.26947415, b: 0.054444212, a: 1} + second: {r: 0, g: 0.6838235, b: 0.14619671, a: 0.503} From 78b679ac01bcbc31d1b466c9419310fe42e73d03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Gervais?= Date: Fri, 8 Apr 2016 09:13:58 -0400 Subject: [PATCH 3/4] =?UTF-8?q?Restaurer=20les=20plateformes=20=C3=A0=20le?= =?UTF-8?q?ur=20=C3=A9tat=20normal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/PlanetManager.cs | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/Assets/Scripts/PlanetManager.cs b/Assets/Scripts/PlanetManager.cs index 37ced3d..7e37f15 100644 --- a/Assets/Scripts/PlanetManager.cs +++ b/Assets/Scripts/PlanetManager.cs @@ -8,9 +8,9 @@ public class PlanetManager : MonoBehaviour public int NbCartiers = 10; public float TailleCartiersEnDegres = 0; //radian -> valeurs 0 a 360 - + public float CartierResetRatioSpeedFactor = 1.0f; + public bool CartierResetRatioSpeedRandomize = false; public GameObject WedgePrefab = null; - public List wedges = new List(); @@ -49,7 +49,34 @@ public class PlanetManager : MonoBehaviour foreach (var w in wedges) { + if (w.offset <= 1.05f && w.offset >= 0.95f) + { + w.offset = 1.0f; + } + else if (w.offset > 1.0f) + { + if (!CartierResetRatioSpeedRandomize) + { + w.offset -= 0.005f*CartierResetRatioSpeedFactor; + } + else + { + w.offset -= 0.005f*CartierResetRatioSpeedFactor*UnityEngine.Random.Range(0f, 2f); + } + } + else if (w.offset < 1.0f) + { + if (!CartierResetRatioSpeedRandomize) + { + w.offset += 0.005f*CartierResetRatioSpeedFactor; + } + else + { + w.offset += 0.005f*CartierResetRatioSpeedFactor*UnityEngine.Random.Range(0f, 2f); + } + } + w.sprite.transform.localScale = new Vector3(w.offset, w.offset,0.0f); } } From 7cad78c03819b179b0cb771aec97ca90b9864a69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Gervais?= Date: Fri, 8 Apr 2016 09:38:11 -0400 Subject: [PATCH 4/4] =?UTF-8?q?Ajout=C3=A9=20des=20valeur=20min=20max=20po?= =?UTF-8?q?ur=20les=20ratios,=20activ=C3=A9=20la=20randomisation=20pour=20?= =?UTF-8?q?le=20reset=20des=20plateformes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/PlanetManager.cs | 14 ++++++++------ Assets/Scripts/testRotate.cs | 15 ++++++--------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/Assets/Scripts/PlanetManager.cs b/Assets/Scripts/PlanetManager.cs index 7e37f15..f9df79b 100644 --- a/Assets/Scripts/PlanetManager.cs +++ b/Assets/Scripts/PlanetManager.cs @@ -8,8 +8,10 @@ public class PlanetManager : MonoBehaviour public int NbCartiers = 10; public float TailleCartiersEnDegres = 0; //radian -> valeurs 0 a 360 - public float CartierResetRatioSpeedFactor = 1.0f; - public bool CartierResetRatioSpeedRandomize = false; + public float CartierResetRatioSpeedFactor = 0.23f; //Entre 0.05 et 1 ou plus on aime que ca restore lentement, randomnly + public bool CartierResetRatioSpeedRandomize = true; + public float CartierMinRatio = 0.4f; + public float CartierMaxRatio = 2.0f; public GameObject WedgePrefab = null; public List wedges = new List(); @@ -61,7 +63,7 @@ public class PlanetManager : MonoBehaviour } else { - w.offset -= 0.005f*CartierResetRatioSpeedFactor*UnityEngine.Random.Range(0f, 2f); + w.offset -= 0.005f*CartierResetRatioSpeedFactor * UnityEngine.Random.Range(-0.5f, 2f); } } else if (w.offset < 1.0f) @@ -72,7 +74,7 @@ public class PlanetManager : MonoBehaviour } else { - w.offset += 0.005f*CartierResetRatioSpeedFactor*UnityEngine.Random.Range(0f, 2f); + w.offset += 0.005f*CartierResetRatioSpeedFactor*UnityEngine.Random.Range(0f, 3f); } } @@ -87,7 +89,7 @@ public class PlanetManager : MonoBehaviour var w = wedges[index]; w.offset = w.offset - 0.25f; - if (w.offset < 0.5f) + if (w.offset < CartierMinRatio) w.offset = 0.5f; @@ -98,7 +100,7 @@ public class PlanetManager : MonoBehaviour var v = wedges[indexOppose]; v.offset = v.offset + 0.25f; - if (v.offset > 1.5f) + if (v.offset > CartierMaxRatio) v.offset = 1.5f; v.sprite.transform.localScale = new Vector3(v.offset, v.offset, 1); diff --git a/Assets/Scripts/testRotate.cs b/Assets/Scripts/testRotate.cs index 55bbf88..34a9c2f 100644 --- a/Assets/Scripts/testRotate.cs +++ b/Assets/Scripts/testRotate.cs @@ -6,15 +6,14 @@ public class testRotate : MonoBehaviour { - public float fireRate = 1.0f; + public float fireRate = 0.2f; private float lastShot = 0.0f; - + private float speed = 33.2f; void Update() { if(Input.GetKeyDown("space") || Input.GetKey("s")) { - Fire(); } } @@ -25,17 +24,15 @@ public class testRotate : MonoBehaviour { { lastShot = Time.time; - var speed = 13.2f; + var theta = Time.realtimeSinceStartup * speed % 360.0f; var pmgr = FindObjectOfType(); pmgr.PushWedge(theta); - - - - var index = pmgr.GetWedgeIndex(theta); + + } @@ -58,7 +55,7 @@ public class testRotate : MonoBehaviour { /// void FixedUpdate() { - var speed = 13.2f; + var theta = Time.realtimeSinceStartup * speed % 360.0f; // Position X du player = angle theta