Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
CharacterSkinsCache.cs
浏览该文件的文档.
2
3namespace Game {
4 public class CharacterSkinsCache {
5 public Dictionary<string, Texture2D> m_textures = [];
6
7 public bool ContainsTexture(Texture2D texture) => m_textures.ContainsValue(texture);
8
9 public Texture2D GetTexture(string name) {
10 if (!m_textures.TryGetValue(name, out Texture2D value)) {
12 m_textures.Add(name, value);
13 }
14 return value;
15 }
16
17 public void Clear() {
18 foreach (Texture2D value in m_textures.Values) {
19 if (!ContentManager.IsContent(value)) {
20 value.Dispose();
21 }
22 }
23 m_textures.Clear();
24 }
25 }
26}
Dictionary< string, Texture2D > m_textures
bool ContainsTexture(Texture2D texture)
Texture2D GetTexture(string name)
static Texture2D LoadTexture(string name)
static bool IsContent(object content)