A Unity project & level editor for making grid-based/block-pushing/Sokoban-like games.
Made with Unity 2019.x LTS
DOTween by Demigiant
http://dotween.demigiant.com/
https://assetstore.unity.com/packages/tools/animation/dotween-hotween-v2-27676
- Add the "GameController" prefab to the scene
See "Example.unity"
The editor window can be found under "Window" -> "Level Editor".
- Define the list of prefabs at
Assets/leveleditorprefabs.txt
, or assign prefabs manually to the "Prefabs" dropdown - Select a game object (prefab)
- Left-click anywhere in the scene to paint in the selected gameObject
- Hold left-click to paint continuously
Note: Selecting "Erase" will clear any objects at that position.
The project assumes plenty about what kind of game you want to make, but there are no rules about friction or win conditions. There are two main object types that you can use in scenes, Wall and Mover.
I typically make objects derive from the Mover class (as the Player class does). Walls and Movers both need child gameObjects with a Box Collider component and tagged with "Tile". See the prefabs "Crate" and "Crate L" under Assets/Resources
for examples of single-tile and multi-tile Movers.
Things that can move and fall and that should be tracked for the undo system.
Static things you should not be able to move and that should stop you from moving, including the ground.
Derives from Mover, handles character movement input. There should only be one Player in the scene.
Manages movers, walls and undo/reset input.
For saving persistent data, like a list of beaten levels by name/string.
Tracks the undo stack.
General utilities class
For caching yield instructions, borrowed from... somewhere on the internet years ago.
The EditorWindow class (see "Using the Editor" above)