A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Separate names with a comma.
Discussion in 'UGUI & TextMesh Pro' started by hollywoodcolor, Aug 22, 2014.
I just want to change
this value in code
GetComponent<Image>().color = Color.green
I tried that and got :
Assets/changeColor.cs(8,30): error CS0246: The type or namespace name `Image' could not be found. Are you missing a using directive or an assembly reference?
can I do word wrap in the console window?
GetComponent<UnityEngine.UI.Image>().color = Color.red;
Thank you that worked!!!
I would have never guessed that.
Has anyone made a list of inspector variables and there direct code equivalences?
Interesting notion, however I've never seen one such list before.
After getting this TOO many times, it's become my habit to add this to EVERY script.
that is great if your a hardcore coder, I can't find : GetComponent<UnityEngine.UI.Image>().color
and I know what I'm looking for.
Unity has a (Open Reference for Image) but in the manual there is no code equivalency or a link to the ScriptReference page.
If you do what Gigi says, then you wouldn't need two write the fully qualified name. Just GetComponent<Image>() would work fine.