Ejemplo n.º 1
0
    void Awake()
    {
        luaState = LuaInstance.instance.Get();

        if (barList != null && isAutoLayout)
        {
            lineFlowLayout = gameObject.GetComponent <UILineFlowLayout>();
            if (lineFlowLayout == null)
            {
                lineFlowLayout = gameObject.AddComponent <UILineFlowLayout>();
            }
            lineFlowLayout.Style  = 0;
            lineFlowLayout.Anchor = 0;
            lineFlowLayout.space  = space;

            for (int i = 0, c = barList.Count; i < c; i++)
            {
                lineFlowLayout.AddChild(barList[i], false);
            }
            lineFlowLayout.mRefreshCount += 2;
        }
    }
Ejemplo n.º 2
0
    void ClearAndReInit()
    {
        SpringPosition tp = DragTarget.GetComponent <SpringPosition>();

        if (tp != null)
        {
            Destroy(tp);
        }
        moveBottomCount = 0;
        for (int i = 0; i < mCellList.Count; i++)
        {
            GameObject.Destroy(mCellList[i].gameObject);
        }
        LineFlowLayout           = gameObject.GetComponent <UILineFlowLayout>();
        LineFlowLayout.Style     = TableDirection == Direction.Vertical ? 1 : 0;
        LineFlowLayout.childrens = new List <UILineFlowLayoutChild>();
        LineFlowLayout.space     = m_CellScpace;
        mCellList = new List <GameObject>();
        DragTarget.transform.localPosition = mOrgPos;
        mCachePos  = mOrgPos;
        mDataCount = 0;
    }