Consolidated the messaging system into a single class with sub functions.
While I like the idea I think it still needs a lot of work. I'll mull over the solution and come up with something better. I think it may be time to make save data have a static helper accessor and swap all of these scriptable objects over to classes. For future me I think the most appropriate place to put it would be the MoosecatIO class.
MoosecatIO Sequential Saving Fixed.
Message Handler Updated (Now cats talk)
Moosecat Updated. Now supports chat and emotes.
GameLoader hard assigned factories, not in time sometimes. (Can fix with a coroutine)
Emote Data Container added.
This one is fairly simple. First the ChatBot will connect the MessageHandler with the messaging event. Then upon receiving messages from users we will grab their IO data from the save system. If that player has an active cat, and that cat is hatched then we will ask it to speak.
Speech bubbles will visually flip when the cat turns so that they stay in front of the speaking cat and the speech bubble text will point towards the cat's mouth. This is a bit brute force at the moment but could be cleaned up in the future. The simplest method is to literally just flip the X rotation of our transform by 180 degrees. The problem with this solution would be the text would be inverted, so we'd need to either re-flip that or have all the flipped bodies be on a separate child chain than the non flipping bodies.
I'll save that problem for a future Oaf.
We have two flows to spawning critters in the game currently. When dealing with game loading we've got a pretty simple process. During the start flow the egg and cat factories initialize and send their instances out to anything that needs it. One of those things is our GameLoader class. That class then waits for the Client to connect.
Once the client connects to Twitch it tells all the different services that it is ready to be subscribed to. At this point the GameLoader iterates through all of the savedata and spawns either eggs or cats depending. It is likely that later this will actually only spawn cats when the player returns from being inactive. So you may see this change slightly in the future.
The second flow involves player interactions. Whenever a player speaks we will check to see if they have any Moosecats. If they have non that tells us that they are a first time user. From there we will tell the SpawnEggCommandHandler to handle a spawn request. It will send that request to the Egg factory. The Factory wil lgenerate a new Egg Prefab that includes the CatIO data for the Moosecat. From there the egg is spawned and that data is sent to MooscatIO. Once the data is catalogued a save request is made.
And that's all there is to it! These are the current two supported means to spawn cats in the Twitch Moosecats game.