I have a string list of characters e I'm trying to get information from another exclusive .cs
file to the main .cs
file.
How to change this
string character_selected;
if (character_selected == "Jin")
{
gameObject.GetComponent<Jin>().getinfo;
}
if (character_selected == "Ken")
{
gameObject.GetComponent<Ken>().getinfo;
}
To something like this:
string character_selected;
gameObject.GetComponent<character_selected>().getinfo;