Browse Source

Fixed merge + turns off sparkles when rod inactive.

master
Joshua Reason 9 years ago
parent
commit
0003065fc9
3 changed files with 10 additions and 12 deletions
  1. +9
    -2
      unity_Project/Assets/Scripts/MagnetLaser.cs
  2. +1
    -1
      unity_Project/Assets/Scripts/thirdPersonController.cs
  3. +0
    -9
      unity_Project/Assets/Textures.meta

+ 9
- 2
unity_Project/Assets/Scripts/MagnetLaser.cs View File

@ -5,7 +5,8 @@ public class MagnetLaser : MonoBehaviour {
private LineRenderer lr;
public GameObject player;
public GameObject rodstart;
public GameObject rodStart;
public GameObject magnetSparkles;
public int segments;
public float randomSize;
private magnetGun gun;
@ -25,9 +26,13 @@ public class MagnetLaser : MonoBehaviour {
void Update () {
if (gun.GravityTarget != null) {
if (magnetSparkles != null)
magnetSparkles.SetActive(true);
lr.enabled = true;
lr.SetVertexCount(segments+1);
lr.SetPosition(0, rodstart.transform.position);
lr.SetPosition(0, rodStart.transform.position);
lr.SetPosition (segments,gun.GravityTarget.transform.position);
Vector3 normalizedV =(gun.GravityTarget.transform.position - player.transform.position);
@ -48,6 +53,8 @@ public class MagnetLaser : MonoBehaviour {
} else {
lr.enabled = false;
if (magnetSparkles != null)
magnetSparkles.SetActive(false);
}

+ 1
- 1
unity_Project/Assets/Scripts/thirdPersonController.cs View File

@ -36,7 +36,7 @@ public class thirdPersonController : MonoBehaviour {
private float movementX;
private float movementY;
private bool grounded;
public bool grounded;
private Rigidbody rigidbody;

+ 0
- 9
unity_Project/Assets/Textures.meta View File

@ -1,9 +0,0 @@
fileFormatVersion: 2
guid: 97def69cc8aa8f0458d67929f23873dd
folderAsset: yes
timeCreated: 1444371283
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

Loading…
Cancel
Save