- Home /
Food bar help
i want to make a food bar, but i don't know how i finish my code, i have this:
public int food = 100;
public GUITexture food100;
public GUITexture food70;
public GUITexture food40;
public GUITexture food10;
void OnGUI()
{
if(food == 100)
{
}
if(food <= 70)
{
}
if(food -= 40)
{
}
if(food <= 10)
{
}
}
what i need to put in:
if(food -= 10)
{
}
to destroy the old image and put the new one?
Comment
Answer by Landern · Mar 19, 2013 at 02:15 PM
Nope, you should use a cut out, similar answers to this type of question have been asked and answered in full. Eric5h5 covered the topic(cutout shaders, circular health) when it comes to circular health, the concept is the same if you are using a rectangle.
Your answer
Follow this Question
Related Questions
How to "paint" the terrain in a script? 1 Answer
Animated Texture Offset 1 Answer
Changing Object Texture When button is pressed. 3 Answers
Differentiating between first import and reimport in the TextureImporter 0 Answers
Terrain Texture 0 Answers