Ejemplo n.º 1
0
    private void Dig()
    {
        if (_onGround && !_falling)
        {
            CanJump = false;
            _attackController.Pause(); // Player cannot attack while digging

            // If the KujangaBoss is active we need to ignore collisions with it when digging
            GameObject kujengaBoss = GameObject.Find("KujengaBoss");
            if (kujengaBoss != null && kujengaBoss.GetComponent <KujengaBossController>().StartedBossFight)
            {
                Physics2D.IgnoreCollision(kujengaBoss.GetComponent <CapsuleCollider2D>(), _capsuleCollider2D, true);
            }

            _animator.SetBool(AnimatorParameter.DIG, true);
            _isDigging = true;
            ResizeColliderToDig();
            StartCoroutine(StopDigAfterCooldown());
        }
    }