cleaned up scripts a little bit
This commit is contained in:
@@ -7,18 +7,11 @@ public class PlayerBehavior : MonoBehaviour
|
||||
{
|
||||
|
||||
[Header("Physics:")]
|
||||
public float moveSpeed;
|
||||
public float jumpSpeed;
|
||||
public float airSpeed;
|
||||
private float _hInput;
|
||||
private Rigidbody2D _rb;
|
||||
private int forward = 1;
|
||||
public PlayerInput playerInput;
|
||||
|
||||
public LayerMask groundLayer;
|
||||
public Vector2 boxSize;
|
||||
public float maxDistanceFromGround;
|
||||
|
||||
[Header("Tambourine:")]
|
||||
[SerializeField] private Launch launcher;
|
||||
[HideInInspector] public bool hasTambourine = true;
|
||||
@@ -37,7 +30,6 @@ public class PlayerBehavior : MonoBehaviour
|
||||
void Start()
|
||||
{
|
||||
_rb = GetComponent<Rigidbody2D>();
|
||||
airSpeed = .5f * moveSpeed;
|
||||
stateController = GameObject.Find("StateController").GetComponent<StateController>();
|
||||
}
|
||||
|
||||
@@ -112,4 +104,25 @@ public class PlayerBehavior : MonoBehaviour
|
||||
}
|
||||
grapplingGun.ReleaseGrapple();
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D col)
|
||||
{
|
||||
if (col.tag == "grappleSurface")
|
||||
{
|
||||
grappleSurface = col.gameObject;
|
||||
}
|
||||
else if (col.tag == "instaDeath")
|
||||
{
|
||||
this.stateController.SetDeathCanvasActive(true);
|
||||
Destroy(this.gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
void OnTriggerExit2D(Collider2D col)
|
||||
{
|
||||
if (col.tag == "grappleSurface")
|
||||
{
|
||||
grappleSurface = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user