void CartelEnter(Collider2D collision) { Debug.Log("Cartel detectado"); Cartel cartel = collision.GetComponent <Cartel>(); dialoguePicture.sprite = cartel.image; dialogueText.text = cartel.text; }
void CartelStay(Collider2D collision) { if (Input.GetButtonDown("Fire1")) { Cartel cartel = collision.GetComponent <Cartel>(); dialoguePicture.sprite = cartel.image; dialogueText.text = cartel.text; Debug.Log("Ver cartel / Dejar de ver cartel"); if (pm.AlowMove == true) { pm.AlowMove = false; dialogueBox.SetActive(true); } else { pm.AlowMove = true; dialogueBox.SetActive(false); } } }