// OnTriggerExit2D is called when the Collider2D other has stopped touching the trigger (2D physics only) private void OnTriggerExit2D(Collider2D collision) { if (collision.transform.tag == "Shot") { if (ShotInRange == collision.transform.GetComponent <ShotBody>()) { ShotInRange = null; } } }
// OnTriggerStay2D is called once per frame for every Collider2D other that is touching the trigger (2D physics only) private void OnTriggerStay2D(Collider2D collision) { if (collision.transform.tag == "Shot") { ShotInRange = collision.transform.GetComponent <ShotBody>(); //if (Attacking || GameManager.BonusManager.IsAutoRange) //{ // if (GameManager.BonusManager.IsAutoRange) // { // RangeReducer(reduceScaleValue * GameManager.BonusManager.GetAutoRangeModifier()); // } //} } }