diff --git a/unity_Project/Assets/Scripts/MagnetLaser.cs b/unity_Project/Assets/Scripts/MagnetLaser.cs index 56fa56f..4b7853c 100644 --- a/unity_Project/Assets/Scripts/MagnetLaser.cs +++ b/unity_Project/Assets/Scripts/MagnetLaser.cs @@ -9,13 +9,14 @@ public class MagnetLaser : MonoBehaviour { public int segments; public float randomSize; private magnetGun gun; + private ParticleSystem[] sparks; // Use this for initialization void Start () { gun = player.GetComponent (); lr = GetComponent (); - + sparks = gun.GetComponentsInChildren(); } @@ -25,6 +26,10 @@ public class MagnetLaser : MonoBehaviour { void Update () { if (gun.GravityTarget != null) { + + sparks[0].enableEmission = true; + sparks[1].enableEmission = true; + lr.enabled = true; lr.SetVertexCount(segments+1); lr.SetPosition(0, rodstart.transform.position); @@ -48,6 +53,8 @@ public class MagnetLaser : MonoBehaviour { } else { lr.enabled = false; + sparks[0].enableEmission = false; + sparks[1].enableEmission = false; } diff --git a/unity_Project/Assets/_Scenes/MainLevel.unity b/unity_Project/Assets/_Scenes/MainLevel.unity index 080ddc3..58fdc54 100644 Binary files a/unity_Project/Assets/_Scenes/MainLevel.unity and b/unity_Project/Assets/_Scenes/MainLevel.unity differ diff --git a/unity_Project/ProjectSettings/ProjectSettings.asset b/unity_Project/ProjectSettings/ProjectSettings.asset index 6faa7cf..ac67012 100644 Binary files a/unity_Project/ProjectSettings/ProjectSettings.asset and b/unity_Project/ProjectSettings/ProjectSettings.asset differ