public static void TransToAlbumData() { ZoneManager.Instance.picArray = new AlbumPic[Info.items.Count]; for (int i = 0; i < Info.items.Count; i++) { ALBUM a = Info.items [i]; AlbumPic pic = new AlbumPic(); pic.id = a.pic_id; pic.userId = a.user_id; pic.picPath = a.pic_path; pic.order = a.order; List <AlbumData> albums; if (ZoneManager.Instance.id2Album.TryGetValue(a.user_id, out albums)) { } else { albums = new List <AlbumData> (); ZoneManager.Instance.id2Album.Add(a.user_id, albums); } AlbumData datas = null; for (int m = 0; m < albums.Count; m++) { if (albums[m].albumName.Equals(a.album_name)) { datas = albums[m]; } } if (datas == null) { datas = new AlbumData(); datas.isSecret = a.is_secret; datas.albumName = a.album_name; albums.Add(datas); } datas.pics.Add(pic); ZoneManager.Instance.picArray [i] = pic; } }
public override void SetData(object o) { base.SetData(o); apic = o as AlbumPic; pic.sprite = apic.pic; }