- Home /
Question by
Zacharias3690 · Oct 26, 2012 at 04:02 AM ·
javascriptguitextures
GUI.DrawTexture removes texture from prefab
var balls : GameObject[];
var x : float;
var y : float;
function OnGUI()
{
for(var i = 0; i < balls.length; i++)
{
GUI.DrawTexture(Rect((x + i *.1) * Screen.width, (y + i * .1) * Screen.height, 30, 30),balls[i].renderer.material.GetTexture("_MainTex"), ScaleMode.ScaleToFit,true);
}
}
all the code is right there. My issue is when I run my game once, the textures are fine, right when I stop the game it takes the texture off of any prefab used in the for loop.
Comment
Your answer
Follow this Question
Related Questions
Negative pixel inset removes ability for touch input on GUITexture 0 Answers
Setting Scroll View Width GUILayout 1 Answer
Move the text in a GUI Button/Box 1 Answer
Gui Text Script 4 Answers
GUI Button Disappearing 1 Answer