void ShowList() { if (gambleItemData.show != null) { if (gambleItemData.winFlag == true) { if (curResultType == resultWinType.isComboType) { mainHeadCell.att = gambleItemData.show.role.attri; mainHeadCell.lv = gambleItemData.show.role.lv; mainHeadCell.Init(gambleItemData.show.role.num); for (int i = 0; i < gambleItemData.show.killarry.Length; i++) { GambleItemCell.CreatGambleItemCell(girdObj, gambleItemData.show.killarry[i], vCellPos + Vector3.right * i * 140); } } else if (curResultType == resultWinType.isSkillType) { for (int i = 0; i < gambleItemData.show.skillarr.Length; i++) { GambleItemCell.CreatGambleItemCell(girdObj, gambleItemData.show.skillarr[i], vCellPos + Vector3.right * i * 140); } } girdObj.GetComponent <UIGrid>().Reposition(); } } }
public static GambleItemCell CreatGambleItemCell(GameObject objParent, int id, Vector3 pos) { UnityEngine.Object obj = WXLLoadPrefab.GetPrefab(WXLPrefabsName.UIGambleItem); if (obj != null) { GameObject go = Instantiate(obj) as GameObject; GambleItemCell fc = go.GetComponent <GambleItemCell> (); Transform goTrans = go.transform; go.transform.parent = objParent.transform; go.transform.localPosition = pos; goTrans.localScale = Vector3.one; fc.Init(id); return(fc); } return(null); }