From 27d20650561983f641ef9b2a70b2b6c5dc02d496 Mon Sep 17 00:00:00 2001 From: Joshua Reason Date: Sun, 11 Oct 2015 01:27:43 +1100 Subject: [PATCH] fixed magnet sounds + put sounds script on player2 --- unity_Project/Assets/Scripts/PlayerSounds.cs | 2 +- unity_Project/Assets/Scripts/magnetGun.cs | 14 ++++++++------ unity_Project/Assets/_Scenes/MainLevel.unity | Bin 542240 -> 542240 bytes 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/unity_Project/Assets/Scripts/PlayerSounds.cs b/unity_Project/Assets/Scripts/PlayerSounds.cs index 4658a25..020bf81 100644 --- a/unity_Project/Assets/Scripts/PlayerSounds.cs +++ b/unity_Project/Assets/Scripts/PlayerSounds.cs @@ -6,7 +6,7 @@ public class PlayerSounds : MonoBehaviour { public GameObject PlayerObject; private thirdPersonController playerController;//Player1 or Player2 object. Assign object component in inspector. //private Collider playerCollider; - public bool FootOnSand = true; + private bool FootOnSand = true; private AudioSource source; private float volLowRange = 0.5f; // Volume Low Range diff --git a/unity_Project/Assets/Scripts/magnetGun.cs b/unity_Project/Assets/Scripts/magnetGun.cs index 451a008..75b6164 100644 --- a/unity_Project/Assets/Scripts/magnetGun.cs +++ b/unity_Project/Assets/Scripts/magnetGun.cs @@ -42,7 +42,7 @@ public class magnetGun : MonoBehaviour { private Color lastTargetColour; - public GameObject magnetTipObject; + //public GameObject magnetTipObject; //----------------------- @@ -148,7 +148,7 @@ public class magnetGun : MonoBehaviour { private void pickUpItem(Collider item){ if (item != null) { - //_playerSoundScript.PlayPickUp(); + _playerSoundScript.PlayPickUp(); if (item == otherPlayer.GravityTarget){ otherPlayer.dropItem(item); @@ -259,13 +259,15 @@ public class magnetGun : MonoBehaviour { private void rotateInput(Collider item){ if (item != null) { - if (Input.GetButtonDown(L_BUTTON_INPUT)) - //_playerSoundScript.PlayRotateL(); // Rotate-Object Sound. ERROR: Held object continuously rotates + if (Input.GetButtonDown(L_BUTTON_INPUT)){ + _playerSoundScript.PlayRotateL(); // Rotate-Object Sound. ERROR: Held object continuously rotates StartCoroutine (rotateItem(item,new Vector3 (0,90,0),0.3f)); + } - if (Input.GetButtonDown(R_BUTTON_INPUT)) - //_playerSoundScript.PlayRotateR(); // Rotate-Object Sound. ERROR: Held object continuously rotates + if (Input.GetButtonDown(R_BUTTON_INPUT)){ + _playerSoundScript.PlayRotateR(); // Rotate-Object Sound. ERROR: Held object continuously rotates StartCoroutine (rotateItem(item,new Vector3 (90,0,0),0.3f)); + } } } diff --git a/unity_Project/Assets/_Scenes/MainLevel.unity b/unity_Project/Assets/_Scenes/MainLevel.unity index ca3781242e98ab540f0d8167094118d01bc9d839..8a7d430a6257139aa316b130ad99f5a8d432d138 100644 GIT binary patch delta 44 vcmZ3`qqv|)v7v>rg{g&k3rh|=OU30`;q3+NEI`Z(#B4y!zP*5*V}l(4ShfyI delta 44 vcmZ3`qqv|)v7v>rg{g&k3ri0B^oYOABJB