Ejemplo n.º 1
0
 private void DestoryScroller()
 {
     if (shopScroller != null)
     {
         shopScroller.transform.SetParent(null);
         UnityEngine.Object.Destroy(shopScroller.gameObject);
     }
     shopScroller = null;
 }
Ejemplo n.º 2
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);
        }