Firstborn/Library/PackageCache/com.unity.ads@4.4.2/Editor/DevX/Settings/UiUtils.cs
Schaken-Mods 9092858a58 updated to the latest editor
I updated everything to the latest Unity Editor. Also realized I had the wrong shaders on my hairs, those are fixed and the hairs look MUCH better!
2023-05-07 17:43:11 -05:00

35 lines
879 B
C#

#if SERVICES_SDK_CORE_ENABLED
using System;
using UnityEditor;
using UnityEngine.UIElements;
namespace UnityEngine.Advertisements.Editor
{
static class UiUtils
{
public static VisualElement GetUiFromTemplate(string templatePath)
{
var template = AssetDatabase.LoadAssetAtPath<VisualTreeAsset>(templatePath);
if (template == null)
{
return null;
}
return template.CloneTree().contentContainer;
}
public static void AddOnClickedForElement(this VisualElement self, Action onClicked, string elementName)
{
var link = self.Q(elementName);
if (link is null)
{
return;
}
var clickable = new Clickable(onClicked);
link.AddManipulator(clickable);
}
}
}
#endif