using System;
using UnityEngine;
namespace eeGames.Widget
{
public class ResourceLoader: IResourceLoader
{
public GameObject LoadUI(WidgetData data)
{
int offset = data.perfabPath.IndexOf("Resources/", StringComparison.InvariantCulture);
string processedString = (data.perfabPath.Split('.')[0]).Remove(0, offset + "Resources/".Length);
#if UNITY_EDITOR
Debug.Log($"load ui {data.Id} in path {processedString}");
#endif
return Resources.Load<GameObject>(processedString);
}
}
}