Placement System
Last updated
Last updated
The placement system is one of the core parts of the grid building system:
It is a state based system that handles place, load, move, rotate and remove actions. Currently there are 5 states implemented which all have a corresponding function call in the PlacementSystem script.
PlacementState
StartPlacement
(string id)
Handles placing new objects on the grid.
Buttons in the shop ui will trigger the StartPlacement Method
LoadObject-PlacementState
InitializeLoadedObject
(PlaceableObjectData podata)
Similar to the Placement state, only that it uses data from the saveFile to rebuild the scene as it was saved on the last game run.
MoveState
StartMoving
(PlacedObject target)
Triggered by the move button in the action tooltip when you hold on a placed object. Enables moving and rotating the selected object.
RemoveState
StartRemoving
(GridDataType gridType)
Triggers removal of only the selected type.
Objects of all other types will be hidden so you have a better view of what to remove.
RemoveAllState
StartRemovingAll()
Triggers removing all grid types at once.
When you select a grid position while in remove all state, all objects on this position will be removed
Note: The Rotate Action is handled directly in each state where it is needed.