- Home /
Question by
george3d2011 · Apr 15, 2014 at 12:53 PM ·
textureloopfor
"for" loop - DrawTexture problem.
hey guys. I'm making an open world game and Im trying to create a food logic system. My problem is a simple one I just can't find how to use "for" loop to draw the same texture multiple times. I used something like that.
public float currentFood = 6;
public float maxFoox = 6;
public Texture foodTex;
for(int i = 0; i < int.Parse(currentFood.ToString()); i++)
{
float temp = 10;
GUI.DrawTexture(new Rect(temp,10,25,25), foodText)
temp = temp + 25;
}
the thing is that by using this code. the texture is not being drawn again in the position my "temp" variable declares! it just moves the already drawn texture to the new position!
Comment
Your answer
Follow this Question
Related Questions
How do I animate a texture to rotate and loop around an imported object? 1 Answer
Assigning UV Map to model at runtime 0 Answers
Quick For Loop Problem 2 Answers
How often does a for loop loop? 1 Answer
Is having a "break" in a "foreach" loop that is itself inside a "for" loop breaking both loops? 3 Answers