GUI State Machine, and OOO Tomorrow
Hey Folks! More GUI work today, getting the multi-GUI system working for interactable items on the ship. Yesterday, I got multiple GUIs to load, and almost switch based on user input. Today, I firmed-up that system and can now switch rapidly between them.
It was a long slog, though.
The trick turned out to be using Unity's animation state machine instead of trying to roll my own state handling code. That's what you see in today's image. The orange box is the default "centered" state for a GUI, and from there, it can flow to various off-screen states on the right or left. And the main features of either "wing" of states is whether to insta-jump off-screen or slide gradually. (Plus the reverse of each.)
There was a lot of false starting involved, and re-learning the animation system. And at one point, I almost gave up when I caught a glimpse of the mountain of work ahead. Not just with this state machine system, but GUI data retention when loaded/unloaded, making them play nice together with game data while running, and generally the complexity of the game I'm building.
Fortunately, keeping at it and taking it one step at a time eventually got it to where it is now: I can interact with a nav station, which raises the orbital nav UI. Then, I can right-arrow to swap to the docking UI, and left-arrow back again. And, in theory, I can add any number of other left/right/up/down UIs to each of those as I want, making a 2D array of UIs you can navigate with arrows.
I think the next step is to setup the docking UI with some live data, and see if I can get it to control actual ship info. That, and have it only apply when within docking range. Hopefully, back to gameplay next week!
Which brings us to the other part of the headline: I'll be out of the office tomorrow for Veteran's Day. As usual, still likely to be around in case anything catches fire. But not working. Hope everyone has a good weekend!