Day 2: Building the infrastructure

Welcome to Day 2 of my 30 Days to the App Store experiment. More about the game soon and how it came about and the current state of it, but for now...
You CAN learn to make video games.
-Greg Dunn, Game Dev Alchemy
Needed a menu system
On day 2, I started the menu system with a state machine... using a state machine is a little more work, but it'll pay off later (and in every other project).
I'm using a Unity toolkit called Surge, created by a friend of mine. You can find details about Surge on his website and you can get Surge from the Asset Store over here. Surge is a stellar toolkit written by a talented guy and it does all kinds of tweens and other cool stuff besides a state machine.
If you're like most people (even developers), you may have NO IDEA what I'm talking about when I say "state machine" – so, let me define it and give a couple of examples.
I'm using this for a menu, which at any given point should only have one panel of content and instructions up at any given time.
A super common use of state machines in games is AI, especially for enemy behavior. Something like this:
- the enemy will be in the "patrol" state where they're walking around and/or looking around
- until they see the player
- then they're in the "attack" state
- unless they lose sight of the player
- then they might move to the "move to last known position of the player" state
- then, if they see the player, they go back to the "attack" state
- if they can't find the player after a certain amount of time, they'll go back to the "patrol" state
So, for a solid menu system that'll show one panel at a time and slide in and out as we move through the steps of the tutorial (and let someone start over and go forward or back) – the easy(ish) way I decided to approach this was with a state machine using Surge, because I knew it had a really flexible and lightweight state machine.
At the end of day 2... my menu state machine currently sort of works, but I need to move the enable/disable into the state change stuff... it's animating/moving correctly, but I'd like to see the panels slide in and out.
I made some solid progress on this, but not as much as I'd like because I don't use state machines as often as I should. I also needed to dig a little deeper to keep the states from being immediately hidden/disabled, which is the default, because I wanted the images to sort of slide on and off the screen.