mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 11:24:46 +00:00
23 lines
654 B
C#
23 lines
654 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace GAS.Runtime
|
|
{
|
|
public static class AttributeSetUtil
|
|
{
|
|
public static IReadOnlyDictionary<Type, string> AttrSetNameCache { get; private set; }
|
|
|
|
public static void Cache(IReadOnlyDictionary<Type,string> typeToName)
|
|
{
|
|
AttrSetNameCache = typeToName;
|
|
}
|
|
|
|
public static string AttributeSetName(Type attrSetType)
|
|
{
|
|
if(AttrSetNameCache==null)
|
|
return attrSetType.Name;
|
|
|
|
return AttrSetNameCache.TryGetValue(attrSetType, out var value) ? value : attrSetType.Name;
|
|
}
|
|
}
|
|
} |