I wouldn’t say it is stupid, but there are far better ways built into Unity.
You should consider learning about ScriptableObjects and then using them as assets on disk to control the game functions of each tower upgrade, all commonly processed through MonoBehaviours.
ScriptableObject usage in RPGs:
The most important concept about ScriptableObjects (SOs) is that they are custom-shaped blobs of data that you can edit inside the Unity inspector.
The serialized values inside a SO map directly to that created asset on disk, the instance of the SO.
When your game runs, it needs some data. One way to get that data is to hard-code it in the code. That is bad because when you change it, you need to change code. That’s why we have things like a SO to configure existing unchanging shipped code.
W…
This looks like a job tailor made for ScriptableObjects!
ScriptableObjects are basically structured blobs of predefined data to help you create content for your game.
For instance if I had a ScriptableObject called Weapon, it might have these properties:
name
detailed name
description
damage
toughness
weight
what it looks like in the inventory
what model it uses in game
what animations the player uses to swing it
I would create many of these Weapons, each one a file on disk (also called an…
Usage as a shared common data container: