Hi,
I’m still relatively new in my coding journey and, as such, am only really beginning to grasp the concept of scripts communicating/passing data to each other via public methods and parameters, etc.
Looking at Rick’s diagram of the four scripts needed to get a resource system up and running for this game, I couldn’t help but think… How would I ever figure out:
a) That 4 such scripts were needed?
b) The specific functionality to be found inside each script
E.g. The Defender script, to me, feels almost superfluous - couldn’t this information (re: Defender cost) be incorporated within the StarDisplay.cs (since StarDisplay also deals with spending currency/stars, etc.)
I imagine if I were to have tried to implement this resource system myself, I wouldn’t have reached the conclusion that 4 scripts were necessary. Instinctively, I might have just used 2…
If anyone can offer any guidance re: how these sorts of coding decisions are made, I’d really appreciate it.
Thanks!