74 public static
object Get(Type type,
string name,
string suffix = null,
bool throwOnNotFound = true) {
75 ArgumentNullException.ThrowIfNull(type);
77 string key = suffix ==
null ? name : name + (suffix.StartsWith(
'.') ? suffix : $
".{suffix}");
82 obj = cacheList.Find(f => f.GetType() == type);
88 List<ContentInfo> contents = [];
91 for (int i = 0; i < reader.DefaultSuffix.Length; i++) {
92 p = $
"{name}.{reader.DefaultSuffix[i]}";
93 if (Caches.TryGetValue(p, out List<object> cacheList2)) {
94 obj = cacheList2.Find(f => f.GetType() == type);
97 if (cacheList == null) {
99 Caches.AddOrUpdate(key, cacheList, (_, _) => cacheList);
104 if (Resources.TryGetValue(p, out ContentInfo contentInfo)) {
105 contents.Add(contentInfo);
110 if (Resources.TryGetValue(key, out ContentInfo contentInfo)) {
111 contents.Add(contentInfo);
114 if (contents.Count == 0) {
116 return throwOnNotFound ? throw new Exception($
"Not Found Res [{key}][{type.FullName}]") : null;
118 obj = reader.Get([.. contents]);
120 if (cacheList ==
null
121 && !
Caches.TryGetValue(key, out cacheList)) {
123 Caches.AddOrUpdate(key, cacheList, (_, _) => cacheList);