This section explains how and when to use what component, and what other components are required and what are optional. You may or may not need all components for development.
GridSquare
This is the basic component generating the grid for you. It is also responsible for initiating the saving process as well as loading the objects back onto the grid.
Every other class will need at least one GridSquare in the scene to work.
Required – None.
Optional – ObjectPlacer.
GridSelector
This class calculates the center or the points of each cell and moves its ’tile’ or MeshRenderer mesh across it.
Grid selector also serves as the preview placement logic, showing the objects before being able to place them down.
This component is the central hub for most other classes in Grid Builder 2.
Required – GridSquare.
Optional – ObjectPlacer, ObjectRemover, ObjectSelector, GridObjectOptions.
SelectObject
This component acts as a your placeable object setup.
This class should sit on a Button object that when clicked, will pass the information set up on this component to the GridSelector for previewing.
Required – GridSelector.
Optional – ObjectPlacer, ObjectSelector, RemoveMode.
ObjectPlacer
Responsible for placing objects and blocking cells, whether it be by hand via the GridSelector class or by loading them directly from a save via the GridSquare.
Required – GridSquare, GridSelector.
Optional – None.
ObjectRemover
This class is responsible for removing placed objects and unblocking cells.
Required – GridSquare, GridSelector.
Optional – ObjectPlacer, ObjectSelector.
ObjectSelector
Handles selection of objects placed on the grid. This can include hover material changes, clicked(selected) material changes and can include a varying sized sliced image to give further visual confirmation of selection.
Required – GridSquare, GridSelector.
Optional – ObjectRemover, GridObjectOptions.
GridObjectOptions
This class contains extra methods for manipulating objects such as moving an already placed object. This is accompanied with an optional pop up menu after selecting an object via the ObjectSelector.
This class could easily be expanded with additional functionality for those confident in programming.
Required – GridSquare, GridSelector, ObjectPlacer, ObjectRemover, ObjectSelector.
Optional – None.
RemoveMode
This class should be added on an object with a button. When clicked, this will enable the ObjectRemover.
Required – GridSquare, GridSelector, ObjectRemover.
Optional – ObjectSelector.
BuildMode
This class should be added on an object with a button. When enabled and clicked, will toggle the visibility of the active grid objects.
It can also hide all objects contained on those grids.
Required – GridSquare, GridSelector.
Optional – ObjectSelector, RemoveMode.