riversong code showcase
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user