WuhuIslandTesting/Library/PackageCache/com.unity.addressables@1.21.12/Editor/Diagnostics/Profiler/UXML/HelpDisplay.cs
2025-01-07 02:06:59 +01:00

39 lines
1.2 KiB
C#

#if ENABLE_ADDRESSABLE_PROFILER && UNITY_2022_2_OR_NEWER
using UnityEditor.AddressableAssets.GUIElements;
using UnityEngine.UIElements;
namespace UnityEditor.AddressableAssets.Diagnostics
{
internal class HelpDisplay : VisualElementsWrapper
{
public HelpDisplay(VisualElement rootView) : base(rootView)
{
MainContainer.EnableInClassList("d_help-area", EditorGUIUtility.isProSkin);
MainContainer.EnableInClassList("help-area", !EditorGUIUtility.isProSkin);
}
public VisualElement MainContainer => GetElement<VisualElement>();
public Label HelpLabel => GetElement<Label>();
public DocumentationButton DocumentationLink => GetElement<DocumentationButton>();
private static VisualTreeAsset s_Template;
private static VisualTreeAsset Template
{
get
{
if (s_Template == null)
s_Template = ProfilerTemplates.HelpDisplay;
return s_Template;
}
}
public static HelpDisplay Create()
{
VisualElement root = Template.Instantiate();
return new HelpDisplay(root);
}
}
}
#endif