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; // <20>ֵ<EFBFBD><D6B5>ļ<EFBFBD>
|
|||
|
public List<Texture2D> Textures; // <20>ֵ<EFBFBD><D6B5><EFBFBD>ֵ
|
|||
|
}
|
|||
|
|
|||
|
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;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|