public virtual void OnTriggerExit2D(Collider2D coll)
{
// add neighboring CollidingObjects
CollidingObject collObj = coll.GetComponent<CollidingObject>();
if (collObj!=null && neighbors.Contains(collObj))
neighbors.Remove(collObj);
// handle exiting water
Water water = coll.gameObject.GetComponent<Water>();
if (water!=null)
inwaters.Remove(water);
// handle detaching
if (collObj!=null && collObj==attachedTo) {
//print("detatching from "+attachedTo.name);
isMovable = true;
Vector3 velocity = attachedTo.GetVelAtPoint(transform.position);
Vector3 velocity2 = -accelMult*curSpeed*GetVelAtPoint(attachedTo.transform.position).normalized;
this.velocity = velocity + velocity2;
attachedTo = null;
if (this is PlayerGear && collObj is Gear)
(collObj as Gear).hasPlayerGear = false;
}
}