IEnumerator init(Transform tr) { //Libs.Resource.UIManager.CloseUI(tr); foreach (Cabinet cabinet in Cabinet.All()) { GameObject go = UIManager.OpenUI("cell", null, tr); CellView cv = go.GetComponent <CellView>(); cv.Id = cabinet.Id; cv.Num = cabinet.Num; Goods good = cabinet.Good(); if (good == null) { cv.Title = "请添加商品"; cv.price = 0; cv.ImagePath = "Image/HeartGrey"; } else { cv.Title = good.Title; cv.price = good.Price; cv.ImagePath = "Image/Gift"; } cv.SetCallBack(x => { if (callBack != null) { callBack(x); } }); yield return(new WaitForEndOfFrame()); } }
// Function to get cabinet list from database public List <Cabinet> GetAllCabinets() { List <Cabinet> cabinets = new List <Cabinet>(); cabinets = Cabinet.All(0, 2147483467); return(cabinets); }