More Code Simplification
With the previous update completed (rewriting the means of tracking what ingredients have been placed on the plate and comparing to what the customer is ordering) I have moved onto the next rewrite.
So I had two separate variables, one to track all classes that were unlocked and one that tracked which prefab that could be spawned within that class.
The problem is it was not a 1 to 1 ratio, that is there were multiple iterations per class. So, newbie class had 6 models, warrior had 3 etc (this was to reduce repetition). So every time a customer is spawned first there was a check to see if the class was unlocked and then which model within that class. This quickly makes for a much messier selection process since we are also tracking which plate the model will approach.
So now I will consolidate this into just one variable. So when a class is unlocked I will just update the variable that tracks which models are unlocked and not the overarching class.
Why did I do this two-variable approach in the first place? In the beginning there was only one model per class so I was directly using the class. It wasn't until a few play throughs that I realized how repetitive it was going to be.
Get Onions Reduce Aggro
Onions Reduce Aggro
Food prep meets RPG
Status | In development |
Author | Design and Deploy |
Genre | Role Playing |
Tags | food-prep |
More posts
- New Functions and ClassesApr 03, 2023
- More RPGFeb 12, 2023
- New versionFeb 05, 2023
- Lesson in ScalabilityDec 17, 2022
Comments
Log in with itch.io to leave a comment.
Hi. Good that you are cleaning up the code. Did you get the models sorted? Did you have to buy new ones?
I have been checking the Unity store every few days. Its challenging because many publishers won't do a full range of characters. So I will probably wind up mixing and matching which unfortunately results in an inconsistent art style.