Hi
I am new to this forum, so I hope this thread comes right
I’m trying to load a resource (an image) stored in assets/Resources called “robot” using this code:
class Card extends System.Object
{
var isFaceUp: boolean = false;
var isMatched: boolean = false;
var img: string;
function Card()
{
img = "robot";
}
}
function BuildGrid()
{
GUILayout.BeginVertical();
for(i = 0; i<rows; i++)
{
GUILayout.BeginHorizontal();
for(j = 0; j<cols; j++)
{
var card:Object = aGrid[i][j];
if(GUILayout.Button(Resources.Load(card.img), GUILayout.Width(cardW)))
{
Debug.Log(card.img);
}
}
GUILayout.EndHorzontal();
}
GUILayout.EndVertical();
}
As you can see the constructor for card fills the img variable with the value “robot” but when I try to test my game I get an error message saying:
BCE0018: The name ‘string’ does not denote a valid type (‘not found’). Did you mean ‘Boo.Lang.Compiler.IO.StringInput’?
I don’t understand why I get this error. Anyone else knows?