private void OnTriggerExit2D(Collider2D collision) { if (collision.GetComponent <CompositeCollider2D>() != null) { if (!swat.IsCharging()) { swat.ChangeDir(); } } }
// Update is called once per frame private void OnTriggerEnter2D(Collider2D collision) { if (preso != null && preso.peacefull == true) { preso.ChangeDir(); } else if (swat != null) { swat.ChangeDir(); } }