static public void Adjust2DPosition(this Component item, Vector2 amount) { Rigidbody2D rigidbody = item.GetComponent <Rigidbody2D>(); if (rigidbody != null) { rigidbody.AdjustPosition(amount); } else { item.AdjustPlanarPosition(amount); } }
static public void AdjustToPosition(this Rigidbody2D item, Vector2 position, float max_distance) { item.AdjustPosition(position - item.position, max_distance); }
static public void AdjustPosition(this Rigidbody2D item, Vector2 amount, float max_distance) { item.AdjustPosition(amount.BindMagnitudeBelow(max_distance)); }