27 lines
858 B
C#
27 lines
858 B
C#
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);
|
|
}
|
|
}
|
|
} |