Skip to content

Instantly share code, notes, and snippets.

@unitycoder
Created March 11, 2015 12:08
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save unitycoder/20cf98d5c5e3a346ee9d to your computer and use it in GitHub Desktop.
Save unitycoder/20cf98d5c5e3a346ee9d to your computer and use it in GitHub Desktop.
Sort custom struct by value
carves.Sort(delegate(Carve a, Carve b) { return a.cumulativeDifference.CompareTo(b.cumulativeDifference); });
/*
// example struct values
public struct Carve
{
public float cumulativeDifference;
public List<int> x;
public List<int> y;
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment