I’m using this course as a base to create a city building. I have created a class named BuildAction based upon the BaseAction.
What I’m not sure about, is when should I show the “ghost” for the selected building.
I’ve added this non elegant solution:
if (Input.GetMouseButtonDown(0))
{
.....
if (selectedAction.IsBuildAction())
{
selectedAction.ShowPreaction(ClearBusy);
}
....
}
I’m using this in order to know if the action is a building action, or a unit action.
But the selectedAction.TakeAction(mouseGridPosition, ClearBusy); should still confirm the construction of the building.
What would be the best way to Implement some onClick confirmation? Should the action send a response saying the ghost is in place to confirm construction? else show ghost?.
I know this question is not the objetive of the course, but i believe is somewhat related.
Thanks.