You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
955 B
C#
36 lines
955 B
C#
/******************************************************************************/
|
|
/*
|
|
Project - MudBun
|
|
Publisher - Long Bunny Labs
|
|
http://LongBunnyLabs.com
|
|
Author - Ming-Lun "Allen" Chou
|
|
http://AllenChou.net
|
|
*/
|
|
/******************************************************************************/
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
namespace MudBun
|
|
{
|
|
public class MudBunEditorWindowBase<T> : EditorWindow
|
|
where T : EditorWindow
|
|
{
|
|
private static Dictionary<string, Texture2D> s_textures = new Dictionary<string, Texture2D>();
|
|
internal static Texture2D GetTexture(string guid)
|
|
{
|
|
Texture2D texture;
|
|
|
|
if (!s_textures.TryGetValue(guid, out texture) || texture == null)
|
|
{
|
|
texture = AssetDatabase.LoadAssetAtPath<Texture2D>(AssetDatabase.GUIDToAssetPath(guid));
|
|
s_textures[guid] = texture;
|
|
}
|
|
|
|
return texture;
|
|
}
|
|
}
|
|
}
|