if (cacheList == null) {
Debug.LogError ("PopulateList: cacheList is NULL");
return;
}
if (modelItem == null) {
foreach (UIDragScrollView ob in gameObject.GetComponentsInChildren<UIDragScrollView>()) {
if (ob.gameObject.name == "ModelItem") {
modelItem = ob.gameObject;
}
}
}
if (parentModelItem == null) {
parentModelItem = modelItem.transform.parent.gameObject;
} else {
modelItem.transform.parent = parentModelItem.transform;
}
childGrid.Reposition ();
switch (PanelType) {
case PanelType.STORE:
foreach (ItemInfoSerializableBase item in cacheList) {
Debug.Log ("Item Destination: " + item.ItemDestination.ToString ());
if (item.ItemDestination == ItemDestination.MARKET_ONLY) {
GameObject newItem = NGUITools.AddChild (parentModelItem, modelItem);
newItem.SetActive (true);
newItem.name = item.Name;
UIItemID itId = newItem.AddComponent<UIItemID> ();
itId
.TransformCache = new List
<Transform
> (); itId.TransformCache.AddRange (newItem.GetComponentsInChildren<Transform> ());
foreach (Transform t in itId.TransformCache) {
switch (t.name.Trim ()) {
case ICON_SPOT:
t.GetComponent<UISprite> ().spriteName = item.ItemIcon;
if (item.ItemT == ItemType.Potion) {
t.GetComponent<UISprite> ().SetDimensions (70, 120);
}
break;