예제 #1
0
파일: Chest.cs 프로젝트: xorle/MineEdit
 public Chest(int CX, int CY, int CS, LibNbt.Tags.NbtCompound c)
     : base(CX, CY, CS, c)
 {
     foreach (NbtCompound item in (c["Items"] as NbtList).Tags)
     {
         //NbtCompound item = (NbtCompound)itm;
         Inventory.Add(item);
     }
 }
예제 #2
0
    public void Collect(GameObject go)
    {
        //
        //	put me in the 1st available slot in the collection I am supposed to go into
        //	(assume InventoryCollection on player)
        //

        // if the player has an inventory, try and put me in there
        InventoryCollection ic = go.GetComponent <InventoryCollection>();

        if (ic != null)
        {
            ic.Add(this);
        }
    }