Hey guys, I'm having trouble trying to assign a label to a variable with Java. Would any of you have any experience at this?
var getFont: UILabel;
function Start ()
{
getFont = GameObject.Find("btn_Cow/cost");
}
Of course, cost resides inside "btn_Cow" and is a simple widget/label. So far I've tried; Material.Find, GameObject.Find, and UILabel.Find. All give me the error;
Assets/Scripts/CowButtonCoolDown.js(28,50): BCE0022: Cannot convert 'UnityEngine.GameObject' to 'UILabel'.
I can manually assign the UILabel just fine(drag and drop through the inspector), but I would prefer the code auto assign it, so I don't have too.