TheInitialProject/Assets/CaoCao/Scripts/Editor/XAsset/GUI/TreeViews/ExtensionMethods.cs

15 lines
405 B
C#
Raw Permalink Normal View History

2024-10-23 16:59:02 +08:00
using System;
using System.Collections.Generic;
using System.Linq;
namespace CaoCao.Editor
{
internal static class ExtensionMethods
{
internal static IOrderedEnumerable<T> Order<T, TKey>(this IEnumerable<T> source, Func<T, TKey> selector,
bool ascending)
{
return ascending ? source.OrderBy(selector) : source.OrderByDescending(selector);
}
}
}