Skip to content

Instantly share code, notes, and snippets.

@samsamm777
Created February 24, 2016 14:21
Show Gist options
  • Save samsamm777/05a8e7c49b84d7b3af6d to your computer and use it in GitHub Desktop.
Save samsamm777/05a8e7c49b84d7b3af6d to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
public class DeliverySheetPanel : MonoBehaviour {
public InventoryManager inventoryManager;
public GameObject listItemPrefab;
// Use this for initialization
void Start () {
//PopulateList ();
}
// Update is called once per frame
void Update () {
PopulateList ();
}
private void PopulateList()
{
foreach(Transform child in transform) {
GameObject.Destroy (child.gameObject);
}
foreach(ItemOrder itemOrder in this.inventoryManager.orders) {
GameObject deliverySheetItem = Instantiate (this.listItemPrefab) as GameObject;
deliverySheetItem.transform.SetParent (this.transform);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment