public void ArticlesToView(Dictionary<int,Article> dict){
Debug.Log("populating main view");
tempItem=this.gameObject;
for(x=0;x<dict.Count;x++){
GameObject obj=null;
if(TotalPrefabs<dict.Count){
while(TotalPrefabs<dict.Count){
obj=CreatePrefabs(count);
count++;
trans=obj.transform.GetChild(1);
artbutton=trans.gameObject;
UIEventListener.Get(artbutton).onClick += logic.OnClick;
UIEventListener.Get(artbutton).onClick += topmenu.OnArticleView;
}
x--;
}
else if(TotalPrefabs>dict.Count){
while(TotalPrefabs>dict.Count){
DestroyPrefabs(dict.Count);
count--;
}
x--;
}
else {
obj=GetPrefab(x);
label=obj.GetComponentInChildren<UILabel>();
label.text=dict[x].Title;
UITexture temptex=tempItem.transform.FindChild(obj.name).GetComponentInChildren<UITexture>();
StartCoroutine(GetImage(temptex,dict[x]));
}
}
if(repopulate){
scroll.ResetPosition();
UIGrid grid=this.gameObject.GetComponent<UIGrid>();
grid.Reposition();
}
repopulate=true;
}