private void ChangeCount()
    {
        UGUIGridWrapContentConfig tConfig = mGridWrapContent.mConfig;

        tConfig.mDataCnt = mDataCount;
        mGridWrapContent.Show(tConfig);
    }
    private void Start()
    {
        mGridWrapContent = this.GetComponent <UGUIGridWrapContent>();

        UGUIGridWrapContentConfig tConfig = new UGUIGridWrapContentConfig()
        {
            mDataCnt           = this.mDataCount,
            mDisplayCellAction = DisplayCell,
            mCreateFunc        = () => { return(GameObject.Instantiate(mCell, this.transform)); }
        };

        mGridWrapContent.Show(tConfig);
    }
Example #3
0
    public void Show(UGUIGridWrapContentConfig pConfig)
    {
        mConfig = pConfig;
        SetDefaultValue();

        DelayCall(() =>
        {
            mGridArrangeBase = GetGridArrangeInstance();

            InitSeeting();

            mGridArrangeBase.AdjustContentSize();
            CreateAllCellInstance();

            //DelayCallAdjustDragState();
            AdjustDragState();
        });
    }
Example #4
0
    public void RepositionCellInEditor()
    {
        //一下{}的代码随便处理的, 否则 UGUIGridArrageHorizontalPage 中会用到 mConfig 然后报错。 后面如有其它问题再看
        {
            this.mConfig     = new UGUIGridWrapContentConfig();
            mConfig.mDataCnt = 30;
        }

        if (Application.isPlaying == false)
        {
            mGridArrangeBase = GetGridArrangeInstance();
        }

        for (int i = 0; i < this.transform.childCount; ++i)
        {
            RectTransform tRectTransform = this.transform.GetChild(i) as RectTransform;
            mCellOffsetPos = GetCellOffsetValue(tRectTransform);

            Vector2 tAnchorPos = GetAnchorPosByDataIndex(i);

            tRectTransform.anchoredPosition = tAnchorPos;
        }
    }