From 03fc23ed5c62aeb5e0bb5b1f90be4d98e9dfef83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-S=C3=A9bastien=20Gervais?= Date: Sat, 9 Apr 2016 16:21:58 -0400 Subject: [PATCH] =?UTF-8?q?appliqu=C3=A9=20shake=20sur=20Earthquake?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Earthquake.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Earthquake.cs b/Assets/Scripts/Earthquake.cs index 1fe03f4..d79a7f0 100644 --- a/Assets/Scripts/Earthquake.cs +++ b/Assets/Scripts/Earthquake.cs @@ -57,7 +57,13 @@ public class Earthquake : MonoBehaviour { { isExploding = true; StartCoroutine(Explode()); - Instantiate(ExplosionParticle); + Instantiate(ExplosionParticle); + var camera = GameObject.Find("Main Camera"); + if (camera) + { + var shaker = camera.GetComponent(); + if (shaker) shaker.shakeTimeAmount = 2.0f; + } } IEnumerator Explode()