Created
March 11, 2015 12:08
-
-
Save unitycoder/20cf98d5c5e3a346ee9d to your computer and use it in GitHub Desktop.
Sort custom struct by value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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