Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System;
  5. [Serializable]
  6. public class inventorySlot
  7. {
  8.     public produce produceOfSlot;
  9.     public bool filledSlot;
  10.  
  11.     public void wipeSlot()
  12.     {
  13.         produceOfSlot = new produce();
  14.         filledSlot = false;
  15.     }
  16. }
  17.  
  18. public class playerInventory : MonoBehaviour {
  19.     public inventorySlot[] allProduceHeld;
  20.     public inventorySlot currentProduceHeld;
  21.     public int currentProduceHeld_Index;
  22.     // Use this for initialization
  23.     void Awake () {
  24.         allProduceHeld = new inventorySlot[9];
  25.         //for(int i = 0; i < allProduceHeld.Length; i++)
  26.         //{
  27.             //allProduceHeld[i].wipeSlot();
  28.         //}
  29.     }
  30.    
  31.     // Update is called once per frame
  32.     void Update () {
  33.         currentProduceHeld = allProduceHeld[currentProduceHeld_Index];
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement