Ejemplo n.º 1
0
    public void Initialize(GameObject childViewPrefab, PrepareViewDelegate prepareViewDelegate, int count)
    {
        ChildViewPrefab = childViewPrefab;
        PrepareViewDelegate = prepareViewDelegate;
        ParentScrollRect = this.GetComponentInParent<ScrollRect>();
        RectTransform ChildViewPrefabRect = (RectTransform)ChildViewPrefab.transform;
        ChildViewHeight = ChildViewPrefabRect.rect.height;
        ParentHeight = ((RectTransform)this.transform.parent).rect.height;

        foreach (Transform child in transform) {
            Destroy(child.gameObject); //remove all setup prefabs
        }

        Refresh(count);

        if (IsInScrollRect) {
            ParentScrollRect.verticalNormalizedPosition = 1;
        }
    }
Ejemplo n.º 2
0
    public void Initialize(GameObject childViewPrefab, PrepareViewDelegate prepareViewDelegate, int count)
    {
        ChildViewPrefab     = childViewPrefab;
        PrepareViewDelegate = prepareViewDelegate;
        ParentScrollRect    = this.GetComponentInParent <ScrollRect>();
        RectTransform ChildViewPrefabRect = (RectTransform)ChildViewPrefab.transform;

        ChildViewHeight = ChildViewPrefabRect.rect.height;
        ParentHeight    = ((RectTransform)this.transform.parent).rect.height;

        foreach (Transform child in transform)
        {
            Destroy(child.gameObject); //remove all setup prefabs
        }

        Refresh(count);

        if (IsInScrollRect)
        {
            ParentScrollRect.verticalNormalizedPosition = 1;
        }
    }