예제 #1
0
    public void Show(UGUIGridWrapContentConfig pConfig)
    {
        mConfig = pConfig;
        SetDefaultValue();

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

            InitSeeting();

            mGridArrangeBase.AdjustContentSize();
            CreateAllCellInstance();

            //DelayCallAdjustDragState();
            AdjustDragState();
        });
    }
예제 #2
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;
        }
    }