void OnTriggerExit2D(Collider2D other) { if (other.tag == "Torch") { illuminated = false; torch = null; } }
void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Torch") { if (other.gameObject.GetComponent <Torch_Toggle>().isLit) { illuminated = true; } torch = other.gameObject.GetComponent <Torch_Toggle>(); } }