unity3d C# 字典排序

    private static void DictonarySort(Dictionary dic, ref Dictionary refDic)
    {
        dic = (from temp in dic orderby temp.Key ascending select temp).
            ToDictionary(pair => pair.Key, pair => pair.Value);
        foreach (var item in dic)
        {
            refDic.Add(item.Key, item.Value);
        }
    }

你可能感兴趣的:(unity3d C# 字典排序)