2D Toolkit Forum
2D Toolkit => Support => Topic started by: hairyconiption on April 29, 2014, 11:25:13 pm
-
I am brand new to 2D Toolkit, so here goes! I need to hide/show a sprite based on info in my script. Specifically star ratings for levels, so I have some code that goes like this
If (star1){
?? Show Star1 image ??
}
-
Hi, you do that the same way you show/hide anything in Unity. You will need a reference to your gameobject, and once you have that you can simply gameObejct.SetActive(false) to hide it.
GameObject star1; // drag a reference to star1 here
if (...) {
star1.SetActive(false); // to hide it
}