private void loadUI() { GlobalFunction.DestroyAllChild(gridTheme.transform); for (int i = 0; i < Constants.itemThemes.Length; i++) { GameObject go = GlobalFunction.AddChild(gridTheme.gameObject, prefab); ItemThemeCell script = go.GetComponent <ItemThemeCell>(); script.SetData(Constants.itemThemes[i]); script.callback = onCallClicked; } }
private void loadUI() { GlobalFunction.DestroyAllChild(gridSprite.transform); for (int i = 0; i < list.Length; i++) { GameObject go = GlobalFunction.AddChild(gridSprite.gameObject, prefab); ItemPicCell script = go.GetComponent <ItemPicCell>(); script.SetData(list[i]); script.callback = callOpenScene; } }