コード例 #1
0
        void LoadCell(int index)
        {
            GameObject obj      = PoolManager.AddChild(scrollRect.content, uiRects[index].prefab.gameObject);
            UILayout   instance = obj.GetComponent <UILayout>();

            instance.RectTransform.pivot = new Vector2(0, 1);
            UIRect uiRect = uiRects[index];

            uiRect.instance = instance;
            instance.RectTransform.anchoredPosition = uiRect.rect.position.Invert(1);
            instance.RectTransform.sizeDelta        = uiRect.rect.size;
            instance.Parent = this;
            instance.SetData(uiRect.data);
        }