コード例 #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);
        }
    }