Пример #1
0
 private void CreateScroller()
 {
     if (shopScroller == null)
     {
         GameObject gameObject = UnityEngine.Object.Instantiate(ShopScrollerPrefab);
         shopScroller             = gameObject.GetComponent <CatalogShopItemScroller>();
         shopScroller.IndexOffset = 1;
         gameObject.transform.SetParent(base.transform, worldPositionStays: false);
         gameObject.transform.SetAsLastSibling();
         GameObject[] scrollerPrefabs = new GameObject[2] {
             ShopItemRow, ScrollHeader
         };
         shopScroller.SetScrollerPrefabs(scrollerPrefabs);
     }
 }
        private void CreateScroller()
        {
            if (shopScroller == null)
            {
                DestoryScroller();
            }
            GameObject gameObject = Object.Instantiate(ShopScrollerPrefab);

            shopScroller = gameObject.GetComponent <CatalogShopItemScroller>();
            gameObject.transform.SetParent(base.transform, worldPositionStays: false);
            gameObject.transform.SetAsFirstSibling();
            GameObject[] scrollerPrefabs = new GameObject[1] {
                ShopRowItem
            };
            shopScroller.SetScrollerPrefabs(scrollerPrefabs);
        }