private void OnTriggerExit2D(Collider2D collision) { if (collision.tag == "Character") { interactiveCharacter.ShowInteraction(false); interactiveCharacter = null; } else if (collision.tag == "Sign") { SfxManager.I.Play("sfx_popup_interazione"); sign.ShowInteraction(false); sign = null; } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.tag == "Character") { interactiveCharacter = collision.GetComponent <Character>(); interactiveCharacter.ShowInteraction(true); } else if (collision.tag == "Sign") { SfxManager.I.Play("sfx_popup_interazione"); sign = collision.GetComponent <WorkSign>(); sign.ShowInteraction(true); } }