diff --git a/Assets/Script/PlayerController.cs b/Assets/Script/PlayerController.cs index cc1bdf9..2c11fd9 100644 --- a/Assets/Script/PlayerController.cs +++ b/Assets/Script/PlayerController.cs @@ -33,6 +33,9 @@ public class PlayerController : MonoBehaviour // Use this for initialization void Start () { +<<<<<<< HEAD +>>>>>>> 26f285ae27df3e2756e31ec432f0687368a8cfcb +======= >>>>>>> 26f285ae27df3e2756e31ec432f0687368a8cfcb rb2 = gameObject.GetComponent(); layerMask = ~layerMask; @@ -48,6 +51,7 @@ public class PlayerController : MonoBehaviour // Update is called once per frame void Update () { +<<<<<<< HEAD >>>>>>> 26f285ae27df3e2756e31ec432f0687368a8cfcb DectectInput(); } @@ -58,6 +62,10 @@ public class PlayerController : MonoBehaviour if (other.transform != null && hit.transform != null) ======= +======= + DectectInput(); + } +>>>>>>> 26f285ae27df3e2756e31ec432f0687368a8cfcb void OnCollisionStay2D(Collision2D other) { @@ -67,6 +75,7 @@ public class PlayerController : MonoBehaviour if (other.transform.name == hit.transform.name) { IsGrounded = true; +<<<<<<< HEAD <<<<<<< HEAD } @@ -78,6 +87,12 @@ public class PlayerController : MonoBehaviour } } +>>>>>>> 26f285ae27df3e2756e31ec432f0687368a8cfcb +======= + } + } + } + >>>>>>> 26f285ae27df3e2756e31ec432f0687368a8cfcb void DectectInput() { @@ -109,6 +124,7 @@ public class PlayerController : MonoBehaviour if (hit.collider == null) +<<<<<<< HEAD { IsGrounded = false; @@ -125,6 +141,18 @@ public class PlayerController : MonoBehaviour } + if (IsGrounded == false) + { +>>>>>>> 26f285ae27df3e2756e31ec432f0687368a8cfcb +======= + hit = Physics2D.Raycast(transform.position, Vector2.down, DownDetector, layerMask); + + if(hit.collider == null) + { + IsGrounded = false; + } + + if (IsGrounded == false) { >>>>>>> 26f285ae27df3e2756e31ec432f0687368a8cfcb @@ -155,8 +183,13 @@ public class PlayerController : MonoBehaviour if (horizontal > 0) { rend.flipX = true; +<<<<<<< HEAD <<<<<<< HEAD } else if (horizontal < 0) +======= + } + else if (horizontal < 0) +>>>>>>> 26f285ae27df3e2756e31ec432f0687368a8cfcb ======= } else if (horizontal < 0) @@ -174,6 +207,7 @@ public class PlayerController : MonoBehaviour rend.flipY = false; } +<<<<<<< HEAD <<<<<<< HEAD rb2.AddForce(new Vector2(horizontal, vertical) * Time.deltaTime, ForceMode2D.Impulse); @@ -191,4 +225,8 @@ public class PlayerController : MonoBehaviour rb2.AddForce(new Vector2(horizontal, vertical)*Time.deltaTime, ForceMode2D.Impulse); } >>>>>>> 26f285ae27df3e2756e31ec432f0687368a8cfcb +======= + rb2.AddForce(new Vector2(horizontal, vertical)*Time.deltaTime, ForceMode2D.Impulse); + } +>>>>>>> 26f285ae27df3e2756e31ec432f0687368a8cfcb }