Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SceneryObjectSizeComparer : IComparer<SceneryObject>
- {
- public int Compare (SceneryObject a, SceneryObject b)
- {
- float aSize = a.renderer.bounds.size.x * a.renderer.bounds.size.z;
- float bSize = b.renderer.bounds.size.x * b.renderer.bounds.size.z;
- if (aSize > bSize) {
- return 1;
- } else {
- return -1;
- }
- }
- }
Add Comment
Please, Sign In to add comment