I was wondering what’s the correct way to create/instantiate skills, enemies and items with varying parameters.
In my case it would be creating a custom skill to be thrown on field based on player’s stats/skills. The skill has variables like damageFrom, damageTo, duration, delay and sometimes there can be a custom variable.
My current game is based on instantiating where it instantiates an empty object with my “BaseSkill” script. Then I was searching for a way to set these mentioned parameters and I ran into a way suggesting something like this:
skill1 = clonedPrefab.GetComponent<BaseSkill>().setDamage(1,3); skill1 = clonedPrefab.GetComponent<Basekill>().setDuration(3); ....
… which looks a bit heavy, especially if there can be dozens of this same action happening at the same time. Should I go with objects as I’m working with C#, or something else? An example or link to a better way would be appreciated. Haven’t done objects with C# before