private void OnTriggerExit2D(Collider2D collision) { if (collision.gameObject.tag == "Rampart") { rampart = null; RampartOffRange(this); } }
private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.tag == "Rampart") { rampart = collision.GetComponent <Rampart>(); RampartOnRange(this); } }