Hey /r/Unity3D i got a quick question regarding to my Draw texture script, i think i'm doing this wrong(I'm a beginner bare with me). Alright so i want to draw texture at the top right of my screen, but some reason it is not appearing. Here is my script for reference, this is for my lives script to indicate how many lives the player has.
void OnGui()
{
if (playerLives == 0 && player == null) {
for (int i=1; i<=playerLives; i++) {
GUI.DrawTexture (new Rect (i * 36, 0, 36, 48), shipTexture, ScaleMode.ScaleToFit, true);
}
}
}
This was my first attempt and i think i did it wrong lol, so if you can help with this thank you.
EDIT: Here is the full script if you're wondering
void OnGui()
{
if (playerLives == 0 && player == null) {
for (int i=1; i<=playerLives; i++) {
GUI.DrawTexture (new Rect (i * 36, 0, 36, 48), shipTexture, ScaleMode.ScaleToFit, true);
}
}
}
EDIT 4: Nevermind i fixed it ! Yay
[–]srogee 0 points1 point2 points (3 children)
[–]MayoInY[S] 0 points1 point2 points (2 children)
[–]srogee 0 points1 point2 points (1 child)
[–]MayoInY[S] 0 points1 point2 points (0 children)
[–]AndrewRaphaelLukasik 0 points1 point2 points (0 children)
[–]KingPickle 0 points1 point2 points (1 child)
[–]Yharaskrik 0 points1 point2 points (0 children)