private void OnTriggerExit2D(Collider2D collision) { if (collision.transform.tag == "Panel" && Player.Active) { _inPanelBounds = null; collision.GetComponentInParent <FirewallScript>().Instruction.SetActive(false); } }
void OnTriggerEnter2D(Collider2D collision) { if (collision.transform.tag == "Panel" && Player.Active) { if (!collision.GetComponentInParent <FirewallScript>().Pressed) { _inPanelBounds = collision.gameObject.GetComponentInParent <FirewallScript>(); collision.GetComponentInParent <FirewallScript>().Instruction.SetActive(true); } } }