- Home /
image not enabling
I have a button that is supposed to disable an image and enable another image as well as adjust bools.
It's doing everything properly EXCEPT enabling the 2nd image.
I've read a bunch of other threads and it looks like i'm doing this properly, does anyone see anything done incorrectly?
thanks!
public void BetterTime()
{
if (ShopUIManager.shopUIManager.TimeUpgrade50Vis == true)
{
if (ShopUIManager.shopUIManager.shopCoins >= 50)
{
ShopUIManager.shopUIManager.shopCoins = ShopUIManager.shopUIManager.shopCoins - 50;
ShopUIManager.shopUIManager.shopCoinsText.text = "" + ShopUIManager.shopUIManager.shopCoins;
ShopUIManager.shopUIManager.TimeUpgrade50.enabled = false;
ShopUIManager.shopUIManager.TimeUpgrade50Vis = false;
ShopUIManager.shopUIManager.TimeUpgrade200.enabled = true;
ShopUIManager.shopUIManager.TimeUpgrade200Vis = true;
CoinsManager.coinsManager.ninjaTimeIncrease ++;
}
}
}
}
yes, your code does stuff. No, I cannot tell what's wrong from just this info.
run it and check what's the problem by investigating the objects in the editor when they should be in the correct state. you sure it's the image and mir the gameobject that's disabled?
so in the editor it does show the bools correctly transitioned and the first image gets disabled. and I dont think its gameobject. there aren't any gameobjects on this particular scene. its only ui elements.
i could switch all the images to gameobjects but then i cant anchor them like I can ui elements.