Game/Library/PackageCache/com.unity.package-manager-ui@2.0.13/Editor/Sources/Services/Common/Resources.cs
2021-01-16 18:29:12 +01:00

19 lines
609 B
C#

using UnityEngine.Experimental.UIElements;
namespace UnityEditor.PackageManager.UI
{
internal static class Resources
{
private static string TemplateRoot { get { return PackageManagerWindow.ResourcesPath + "Templates"; } }
private static string TemplatePath(string filename)
{
return string.Format("{0}/{1}", TemplateRoot, filename);
}
public static VisualElement GetTemplate(string templateFilename)
{
return AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(TemplatePath(templateFilename)).CloneTree(null);
}
}
}