Archived
Private
Public Access
1
0
This repository has been archived on 2026-02-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
ProjectBackup/Unity/Minecraft/Assets/Scripts/UI/CreativeInventory.cs
2022-11-12 13:10:03 +01:00

25 lines
725 B
C#

using System.Collections.Generic;
using Items;
using Terrain;
using UnityEngine;
namespace UI {
public class CreativeInventory : MonoBehaviour {
public GameObject slotPrefab;
public World world;
private readonly List<ItemSlot> _slots = new List<ItemSlot>();
private void Start() {
for (int i = 1; i < world.blockTypes.Length; i++) {
GameObject obj = Instantiate(slotPrefab, transform);
ItemStack stack = new ItemStack((byte) i, 64);
ItemSlot slot = new ItemSlot(obj.GetComponent<UIItemSlot>(), stack);
slot.creative = true;
_slots.Add(slot);
}
}
}
}