We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have an inventory system which works with IDs
public Inventory inventory; /... inventory.AddItem(ID); .../
how can i assign IDs to the individual Blocks and read them from another script (the block breacking script working with RayCast)
The text was updated successfully, but these errors were encountered:
Voxelmetric (all versions) has ids for each block type. You could use:
item.id = block.type;
The voxel tutorial from my website does not have ids for block types. You could implement your own ids like this:
//block.cs using System.Collections.Generic; public class Block { private static Dictionary<Type, int> blockIds = new Dictionary<Type, int>() { { typeof(Block), 0}, { typeof(BlockAir), 1}, { typeof(BlockGrass), 30}, { typeof(BlockLeaves), 93}, { typeof(BlockWood), 12} }; public int id { get { return blockIds[GetType()]; } } ...
This will let you use any id you want for each block to match whatever you're using for the inventory.
Sorry, something went wrong.
No branches or pull requests
I have an inventory system which works with IDs
public Inventory inventory;
/...
inventory.AddItem(ID);
.../
how can i assign IDs to the individual Blocks and read them from another script (the block breacking script working with RayCast)
The text was updated successfully, but these errors were encountered: