예제 #1
0
    // TODO: Items should be loaded from resources probably?

    void Awake()
    {
        _scrollRect.normalizedPosition = Vector2.up;

        _itemWidgetTemplate = GetComponentInChildren <ShopItemWidget>(true);
        _itemWidgetTemplate.gameObject.SetActive(false);
    }
예제 #2
0
 void SetupItems(List <ShopItemWidget> widgetPrefabs)
 {
     for (int i = 0; i < widgetPrefabs.Count; i++)
     {
         ShopItemWidget spawnedWidget = Instantiate <ShopItemWidget>(widgetPrefabs[i], _itemLayout);
         _itemWidgets.Add(spawnedWidget);
     }
 }