Watch tutorial on youtube here !
A code plugin that allows very basic city building functionallities.
- PlacementManagerComponent : A component that allows comunication to the system (e.g placing objects, replacing and checking for selection)
- PlacmentActor : an actor that can be spawned to the scene by PlacementManagerComponent
- GridManager : an Actor that is responsible for grid and reserve system (so two objects can not be plcaed at the same place at the same time)
the main component that can be added to the player and it is the main way to comunicate with the system. the process of adding an object to the scene, proccess simplified into 3 steps (functions):
- Placement_Start() : starts the placement process takes in an actor (PlacementActor).
- Placement_Accept() : places the actor that been taken in Placement start and places in the currrent location and finishes the placement process.
- Placement_Cancel() : cancels the placement process.
- Replacement_Start() : starts the Replacement process takes in an actor (PlacementActor) and starts to replace that actor.
- Replacement_Accept() : places the actor that been taken in Replacement start and places in the currrent location and finishes the Replacement process.
- places the actor that been taken in Replacement start to its original locatio and cancels the Replacement proces.
- SelectUnderCursor() : is a function that selects actor under the cursor and calls OnSelected for the actor, and unselects the already selceted ons (calls OnUnselected for that actor).
An actor that can be placed to the scene by PlacementManagerComponent.
- RegisterForReplacement()
- RemoveBuilding()
- OnPreviewPlacement() : called when the actor is spawned to the scene(called on placment_start for the actor) and not yet accepted (placment_accept() not yet called for the actor
- OnPlaced() : called when the actor spawned (called for actor when Placement_accept called
- OnHover() : Called when the actor hovered by the mouse
- OnUnhover() : Called when the actor unhovered
- OnSelected() : called when the the actor selected
- OnUnselected() : called when this actor is un selected
- OnPlacementPorcessValidation() : called on tick() for validating the current location in both Placement and replacement processes
- OnReplacement_Start() : called when replacement process started for this actor
- OnReplaced() : called when the replacement process is finished for this actor (called for both Replacement_accept and Replacement_cancel )
An Actor that is responsible for grid and reserving places to actors so two actors can not be positioned at the same place at the same time (one cells can not be reserved more than one PlacementActor)
- DrawCells() : draws cells