function OnGUI ()
{
for(var i : int = 0; i < texturePlus.length; i++)
{
if(GUI.Button(Rect(10, 10 + 50 * i, 50, 50), texturePlus*))*
this.GetComponent(scriptName_).scriptVar*++;
}
}*
I want to use the string scriptVar as a variable name. But it dosent work, is it some way to solve this?
Thanks!,I wont to use the the string scriptVar as my variable name. But it dosent work, can i solve this in some other way?
Thanks!
code:
var texturePlus : Texture[];_
var scriptName : String[];
var scriptVar : String[];
function OnGUI ()
{
for(var i : int = 0; i < texturePlus.length; i++)
{
if(GUI.Button(Rect(10, 10 + 50 * i, 50, 50), texturePlus*))*
this.GetComponent(scriptName).scriptVar_++;_
}
}