maint: added livewatch asset
This commit is contained in:
20
Assets/Plugins/LiveWatchLite/Scripts/Editor/WatchGUICache.cs
Normal file
20
Assets/Plugins/LiveWatchLite/Scripts/Editor/WatchGUICache.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user