Browse Source

fixed magnet sounds + put sounds script on player2

master
Joshua Reason 9 years ago
parent
commit
27d2065056
3 changed files with 9 additions and 7 deletions
  1. +1
    -1
      unity_Project/Assets/Scripts/PlayerSounds.cs
  2. +8
    -6
      unity_Project/Assets/Scripts/magnetGun.cs
  3. BIN
      unity_Project/Assets/_Scenes/MainLevel.unity

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

@ -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

+ 8
- 6
unity_Project/Assets/Scripts/magnetGun.cs View File

@ -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));
}
}
}

BIN
unity_Project/Assets/_Scenes/MainLevel.unity View File


Loading…
Cancel
Save