Created
February 24, 2016 14:21
-
-
Save samsamm777/05a8e7c49b84d7b3af6d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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