This is a Unity3D project that refactors AlexStv's Voxel Tutorial.
Things I've changed:
- Standarized code style.
- Move everything inside the
Voxelsnamespace. - Removed terrain generators. No caves, no trees.
- Removed noise-related code.
- Blocks are represented as
ints instead ofBlocksubclasses. - "Infinite size" map editor out of the box, start with a single block and build huge worlds.
-
Worldserialization uses gzip compression. - Modified
tiles.pngwith two new tiles:sandanderror. - Refactored some magic numbers to
Assets/MapEditor/MapConstants.cs.
Blocks are static so just an id reference to some container that holds each block details should suffice for most cases.
This has the benefit of making serialization super easy and space efficient.
LMBadds the current block to wherever you click, if possible. Default: Stone.Tabswitches between Add and Replace modes. Default: Add.1switches current block toCobblestone2switches current block toStone3switches current block toDirt4switches current block toGrass5switches current block toSand9switches current block toError0switches current block toAirXtoggle burst mode forLMB(Input.GetKeyvsInput.GetKeyDown)Bbackup world whatever is configured inMapConstants.SaveFiles. Default:<root>/maps.RMD+WASDto move around the sceneRMD+Eto move upwardsRMD+Qto move downwardsEscapepauses Unity Editor if in Play Mode
- Add adds a block next to the clicked block.
- Replace replaces the clicked block.
I'm following the same licensing as AlexStv's original tutorial which can be found here.
Basically you are free to use this project however you like.
The only asset that's not allowed for commercial usage is the Assets/MapEditor/tiles.png.
It's very easy to replace with one made by yourself.