Our first shot at creating a scoring module for our mini game. This video explains how to access variables and functions across script files (file A can talk to file B).
And people who are not newbies at Unity will see this method, shriek, and start babbling about how it’s just wrong and should never be used…
Yeah, but the “correct” way is NOT beginner-friendly. And this way works, so just go with the flow, dude, and tone down the East-coast ‘tude.
Sidebar: I don’t really dislike people from the East coast. You’re fine. Just not West-coast mellow, you know?
Static Variables and Functions (7:09)
Besides the code below you’ll need to make sure the GameData.foo lines in the BombHit and DestroyOnClick scripts are uncommented.