Files
project-reset/Assets/Plugins/LiveWatchLite/Scripts/Editor/WatchGUICache.cs
2025-08-31 18:14:07 -04:00

20 lines
540 B
C#

using System.Collections.Generic;
using UnityEngine;
namespace Ingvar.LiveWatch.Editor
{
public class WatchGUICache
{
private Dictionary<string, GUIContent> _textToGUIContentCache = new();
public GUIContent GetContent(string text)
{
if (_textToGUIContentCache.TryGetValue(text, out var guiContent))
return guiContent;
guiContent = new GUIContent(text, text);
_textToGUIContentCache[text] = guiContent;
return guiContent;
}
}
}