I know this is a duplicate question that's been asked before, but all of the questions I've found refer to C# in general, but not Unity which I believe supports up to .NET 4.6 and not the newest framework?
I have a function that passes multiple variables if a bool is true for each of several categories.
void CheckData()
{
if (int 1 > int 2)
{
otherScript.Function(var 1, var 2, var 3)
}
}
That function queries an SQL database and defines the inputted variables based on the SQL data. Is there an easy way to return the value of multiple variables? From the research I've been doing it seems there is a way to do so in newer versions of .NET, but not with Unity since it doesn't support Tuples?
I've also read people say you can return an array and then sort the data outside of the function, but then I've read other people saying the opposite and the information I've found is inconsistent.
Could anyone please let me know the simplest way to achieve this? If needed I'll just hard code each individual variable and do it manually, but I'm trying to keep my code clean so if there's a better way to do it I'd like to know before I spend hours coding something improperly.
Edit: The suggested duplicate post link showed how to accomplish this by making another class, but I was looking for a simpler solution which was answered below. Thank you.