I need something like
//Vector3 nearest = PlayerUnits.Sort(delegate(Transform t) { return (transform.position - t.position).sqrMagnitude; }).First();
to exist...
to where it sorts,, finds the first answer, and then stops sorting how is this possible? the only way to sort that i know of in c# is:
Pick first object during a sort and then stop sorting
//Vector3 nearest = PlayerUnits.Sort(delegate(Transform t) { return (transform.position - t.position).sqrMagnitude; }).First();
to exist...
to where it sorts,, finds the first answer, and then stops sorting how is this possible? the only way to sort that i know of in c# is:
Code (CSharp):