/*private void OnEnable() * { * //initialPos = transform.position; * activateRocket = false; * }*/ private void ReachedDistination() { activateRocket = false; PM.Jump(PM.jumpForce); OnDeath(); PM.SetPlayerState(States.STATE_NORMAL); aux.DestroyInRadius(transform.position, destroyRadius); }
private void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Player")) { Rigidbody2D rb = other.GetComponent <Rigidbody2D>(); Vector2 velocity = rb.velocity; if (velocity.x <= 4) { velocity.x = 5; } velocity.y = boost; rb.velocity = velocity; aux.DestroyInRadius(transform.position, radiusToDestroy); onDeath(); GameManager.instance.AddCombo(50); } else if (other.CompareTag("Wall")) { onDeath(); } }