void Update() { if (Input.GetMouseButton(0) && IsGrounded) { body.velocity = Vector2.up * tapforce; SoundCTRL.PlaySound("Jump"); } /*if(Input.GetMouseButton(1)) * { * body.velocity = Vector2.right * tapforce; * }*/ }
void OnTriggerEnter2D(Collider2D collider) { if (collider.gameObject.tag == "ScoreZone") { SoundCTRL.PlaySound("Coin"); OnPlayerScored(); } if (collider.gameObject.tag == "DeadZone") { SoundCTRL.PlaySound("Dead"); body.simulated = false; OnPlayerDied(); } }