riversong code showcase
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine.UIElements;
|
||||
|
||||
namespace DanieleMarotta.RiversongCodeShowcase
|
||||
{
|
||||
public class StoragePanelUIView : UIView<StoragePanelModel>
|
||||
{
|
||||
private VisualElement _products;
|
||||
|
||||
public override UniTask InitializeAsync(UIService uiService, VisualElement rootElement)
|
||||
{
|
||||
base.InitializeAsync(uiService, rootElement);
|
||||
|
||||
_products = rootElement.Q<VisualElement>(className: "storage-panel__products");
|
||||
|
||||
return UniTask.CompletedTask;
|
||||
}
|
||||
|
||||
protected override void OnModelChanged()
|
||||
{
|
||||
base.OnModelChanged();
|
||||
|
||||
var template = UIService.TemplateLibrary.BuildingPanel.StorageProduct;
|
||||
_ = UIService.CreateViews<StoragePanelProductModel, StoragePanelProductUIView>(Model.Products, _products, template);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user