Advertisement
LittleAngel

OnEnable

Oct 14th, 2011
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. void OnEnable (){
  2. // In case you do not have or have removed your inventory manager after this script was initialized, reset the itemListObject and itemList.
  3. itemListObject = null;
  4. itemList = null;
  5. // The Inventory Manager must be called ("InventoryManager" and you must have only one.)
  6. if (GameObject.Find("InventoryManager")) {
  7. itemListObject = GameObject.Find("InventoryManager");
  8. itemList = GameObject.Find("InventoryManager").GetComponent<ItemList>().items;
  9. }
  10. }
  11.  
  12.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement