39 lines
764 B
C#
39 lines
764 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace GameLogic
|
|
{
|
|
|
|
[System.Serializable]
|
|
public class TextureEntry
|
|
{
|
|
public string Key; // ×ÖµäµÄ¼ü
|
|
public List<Texture2D> Textures; // ×ÖµäµÄÖµ
|
|
}
|
|
|
|
public class TextureManager : MonoBehaviour
|
|
{
|
|
public List<TextureEntry> m_Texture2ds;
|
|
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
|
|
public TextureEntry GetTexture(string key)
|
|
{
|
|
foreach (var entry in m_Texture2ds)
|
|
{
|
|
if (entry.Key == key)
|
|
{
|
|
return entry;
|
|
}
|
|
}
|
|
Debug.LogError("Texture not found: " + key);
|
|
return null;
|
|
}
|
|
}
|
|
}
|