void OnTriggerExit2D(Collider2D other) { if (isUsing && null != collidingWith) { collidingWith.StopUsing(gameObject); } collidingWith = null; }
void OnTriggerEnter2D(Collider2D other) { collidingWith = other.gameObject.GetComponent <UsableObjectCS> (); }