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