private GameObject SetUpCell(int index) { GameObject cell = GetCell(index); if (cell == null) { Debug.LogWarning("CellPrefab is Null!!"); GameObject.Destroy(cell); } CallLua(index); mCellList.Add(cell); LineFlowLayout.AddChild(cell); return(cell); }
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; } }