diff --git a/unity_Project/Assets/Materials/Player1.mat b/unity_Project/Assets/Materials/Player1.mat new file mode 100644 index 0000000..bee20ba Binary files /dev/null and b/unity_Project/Assets/Materials/Player1.mat differ diff --git a/unity_Project/Assets/Materials/Player1.mat.meta b/unity_Project/Assets/Materials/Player1.mat.meta new file mode 100644 index 0000000..6cad532 --- /dev/null +++ b/unity_Project/Assets/Materials/Player1.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 0fbcbaa69a443464d8f92830db4846ad +timeCreated: 1440752527 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/unity_Project/Assets/Scripts/magnetGun.cs b/unity_Project/Assets/Scripts/magnetGun.cs index 36eaa6c..c4e651a 100644 --- a/unity_Project/Assets/Scripts/magnetGun.cs +++ b/unity_Project/Assets/Scripts/magnetGun.cs @@ -20,6 +20,7 @@ public class magnetGun : MonoBehaviour { public GameObject gravityWell; private Collider GravityTarget; private Vector3 rayHitPoint; + private Vector3 targetOffset; public float objectSpeed; public float magnetRange = 20; @@ -27,6 +28,8 @@ public class magnetGun : MonoBehaviour { public float rotateSpeed; public float minDistance = 3.0f; + private float maxWalkSpeed; + // Use this for initialization void Start () { if (topScreen) @@ -34,6 +37,8 @@ public class magnetGun : MonoBehaviour { else playerScreen = -1; + maxWalkSpeed = playerController.movementSpeed; + } @@ -104,6 +109,8 @@ public class magnetGun : MonoBehaviour { item.attachedRigidbody.constraints = RigidbodyConstraints.FreezeRotation; gravityWell.transform.position = rayHitPoint; GravityTarget = item; + targetOffset = GravityTarget.transform.position - rayHitPoint + (Vector3.up * 0.05f); + playerController.movementSpeed = 200.0f; @@ -119,7 +126,7 @@ public class magnetGun : MonoBehaviour { private void moveItem(Collider item){ if (item != null) { float step = objectSpeed * Time.deltaTime; - Vector3 direction = gravityWell.transform.position - item.transform.position; + Vector3 direction = gravityWell.transform.position - item.transform.position + targetOffset; direction = Vector3.ClampMagnitude(direction,1.0f); item.attachedRigidbody.AddForce(direction * objectSpeed * Time.deltaTime); @@ -138,7 +145,7 @@ public class magnetGun : MonoBehaviour { GravityTarget = null; - playerController.movementSpeed = 5000.0f; + playerController.movementSpeed = maxWalkSpeed; playerController.cameraSpeedX = 250.0f; playerController.cameraSpeedY = 120.0f; diff --git a/unity_Project/Assets/_Scenes/ScafoldingTest.unity b/unity_Project/Assets/_Scenes/ScafoldingTest.unity index 70195d8..c114396 100644 Binary files a/unity_Project/Assets/_Scenes/ScafoldingTest.unity and b/unity_Project/Assets/_Scenes/ScafoldingTest.unity differ diff --git a/unity_Project/Assets/prefabs/pipe_large1.prefab b/unity_Project/Assets/prefabs/pipe_large1.prefab new file mode 100644 index 0000000..1be4273 Binary files /dev/null and b/unity_Project/Assets/prefabs/pipe_large1.prefab differ diff --git a/unity_Project/Assets/prefabs/pipe_large1.prefab.meta b/unity_Project/Assets/prefabs/pipe_large1.prefab.meta new file mode 100644 index 0000000..609ff77 --- /dev/null +++ b/unity_Project/Assets/prefabs/pipe_large1.prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c30e3469a139fe646bc1651149e4c505 +timeCreated: 1440745563 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: