So i have some functions called ability1,ability2 and i was wondering can i choose which abilty gets chosen with a public int that is changed in the inspector and it determines which ability gets called. For example if that public int = 1 then the ability1 function gets called?
Hello,
If there are few cases, i think you can go with a Ability wrapper function.
function void Ability(){
switch (abilityID)
{
case 1 : Ability1();break;
case 2 : Ability2();break;
...
}
}
For testing purpose, i guess that’s ok.
For more complex case, you could also use reflexion to call a method by it’s name. (example) , or take a look at delegate in C#.