declaration order sorting

This commit is contained in:
honzapatCZ
2021-03-04 19:46:27 +01:00
parent 9c80354acf
commit 4593e4c669
3 changed files with 35 additions and 2 deletions

View File

@@ -173,8 +173,16 @@ namespace FlaxEditor.CustomEditors.Editors
return string.Compare(Display.Group, other.Display.Group, StringComparison.InvariantCulture);
}
// By name
return string.Compare(Info.Name, other.Info.Name, StringComparison.InvariantCulture);
// By declaration order
if (Info.MetadataToken > other.Info.MetadataToken)
return 1;
else if (Info.MetadataToken < other.Info.MetadataToken)
return -1;
else
{
// By name
return string.Compare(Info.Name, other.Info.Name, StringComparison.InvariantCulture);
}
}
return 0;