31 lines
740 B
C#
31 lines
740 B
C#
using Cysharp.Threading.Tasks;
|
|
using UnityEngine.UIElements;
|
|
|
|
namespace DanieleMarotta.RiversongCodeShowcase
|
|
{
|
|
[UIView("building-placement-tooltip")]
|
|
public class BuildingPlacementTooltipUIView : UIView
|
|
{
|
|
private Label _tooltipText;
|
|
|
|
public override UniTask InitializeAsync(UIService uiService, VisualElement rootElement)
|
|
{
|
|
base.InitializeAsync(uiService, rootElement);
|
|
|
|
_tooltipText = rootElement.Q<Label>();
|
|
|
|
return UniTask.CompletedTask;
|
|
}
|
|
|
|
public void SetText(string text)
|
|
{
|
|
_tooltipText.text = text;
|
|
Show(true, true);
|
|
}
|
|
|
|
public void Clear()
|
|
{
|
|
Show(false, true);
|
|
}
|
|
}
|
|
} |