private void OnTriggerStay2D(Collider2D collision) { if (collision.tag == "Escalera") { inLadder = true; } if (collision.tag == "Item") { currentItem = collision.GetComponent <Item>(); } if (collision.gameObject.tag == "Basurero") { if (Input.GetKeyDown(keyAccion) && statePlayer != StatePlayer.Stunt) { enableMovement = false; statePlayer = StatePlayer.InHealling; delayHealling = auxDelayHealling; gameObject.layer = 9; Basurero basurero = collision.gameObject.GetComponent <Basurero>(); if (life < maxLife) { life = life + basurero.countLifeRecover; if (life > maxLife) { life = maxLife; } //Debug.Log("ENTRE"); animator.SetTrigger("EntrarAlTacho"); } } } }
private void Awake() { basurero = this; }