protected override void OnTriggerEnter(Collider collision) { if (collision.transform.tag == "Player") { if (collision.transform.GetComponent <PlayerBehavior>().breakRock) { this.Die(); PlayerMechanics.Move(collision.transform.GetComponent <PlayerBehavior>()); } else { collision.transform.GetComponent <PlayerBehavior>().Die(); } } }
// Update is called once per frame void FixedUpdate() { if (!changeMovement) { PlayerMechanics.Move(this); } if (InputManager.Toched() && canTap) { canTap = false; onTap(this); StartCoroutine(TapCooldown(tapCooldown)); } if (InputManager.Drag().x > 0 && canDrag) { canDrag = false; onDrag(this); StartCoroutine(DragCooldown(dragCooldown)); } }