I honestly thought this would take me all weekend. But here we are.
New button the tool bar. Research!
Not much to look at the moment. We have faded buttons for research that is not unlocked, and we have buttons for available research. This is clearly not going to be the researchs in the game, this is simply for testing. These buttons are hooked up to a database and enum that fills the buttons with whatever is in the database. I don't really want to spend the time to have it dynamically create the positions of the buttons, since I don't think it needs to be randomized or something...the research screen will likely be the same everytime. However, the order of the buttons in Unity will be the same, which I can use to fill the correct links to the correct research.
So, what happens when we click a button?
The button fades and is not interactable, and a timer starts. The button actually sends a command to the data layer to handle the command, which is to switch research to whatever research I send down to the data layer. It then sends the research for my display to listen to, and on update it watches the time to unlock...what happens when the timer runs out?
The next research unlocks, and the Fire button is now permanently disabled. Awesome! The timer also continues when on other screens, since the data layer isn't apart of the display layer, and I can set the display layer to inactive when it's not needed.
So to polish this, we would need a tooltip to see requirements of research, maybe hints as to where to go to unlock research and so forth, and definitely things like multiple researches unlocked by a node or one node unlocking multiple researches...I want to section research into 4 categories of the 4 systems in the game (build, navigation, research, and combat). And we can also allow the player to scroll around and view the research tree, zoom out, so forth. But right now this works perfectly. I can change the research quickly, and none of the display changes the state of any of the research...it simply sends a command down to the data to ask them to switch, and it makes sure it is a valid command.
So we're onto the last system. Combat. In this, I wanted to play around with Unity's ECS system, see what shakes out. I will need a new building of a turret, to defend our colony. I expect this to take awhile, since I've never used ECS, so sounds like fun. Stay tuned!