Combining strings and assign to a variable

I have two dynamic strings variables. I want to combine their values and assign them to a different variable (in this case a function variable). For example:

var level1Hard : float[] = [a, b, c];
//...


//These are actually generated depending on the level
var thisLevel : String = "level1";
var thisDifficulty : String = "Hard";


//THIS IS WHERE I WANT THE MAGIC TO HAPPEN
//CALL THE FUNCTION INSERTING THE DEFINED level1Hard : float[] IN AS THE VARIABLE
levelSettings(thisLevel + thisDifficulty)


function levelSettings(settings : float[])
{

...

}

I tried using eval(). Worked fine until I tried to make a build to the iPhone. Complained about System.dll and assembly stripping. For whatever reason assembly stripping freezes my game when this script is run.

Any suggestions?

The Mono code generator can operate in two modes: Just-in-Time compilation or JIT, and Ahead-of-Time compilation or AOT.

On the iphone, AOT will prevent dynamic code, such as the one you wrote, to run.

You will need to find another way of writing that, one that doesn’t require dynamic code.

Wow. Good to know and thanks for the reply. Where does one go to find that kind of information? Sometimes I find it frustrating to have found a way to do something only to have it blow up in my face because of a technicality I can’t seem to find. Your expertise is much appreciated. I’ll keep poking around for other solutions.