DCS/ruiyiweiUX/Assets/GeneralTools/Scripts/Always/ResourcesStore.cs

36 lines
950 B
C#
Raw Normal View History

2026-06-09 13:59:11 +08:00
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
namespace GeneralTools
{
public class ResourcesStore
{
public static Dictionary<string, List<object>> resourceDict = new Dictionary<string, List<object>>();
public static void AddResource(string key, bool cover, params object[] resource)
{
key = Path.GetFullPath(key);
if (!cover && resourceDict.ContainsKey(key))
{
}
else
{
resourceDict[key] = new List<object>(resource);
}
}
public static List<object> GetResource(string key)
{
key = Path.GetFullPath(key);
if (resourceDict.ContainsKey(key))
{
return resourceDict[key];
}
else
{
return new List<object>();
}
}
}
}