I have a little problem with GUI in Unity. I am randomly picking one number 0 or 1 and depends on it i am trying to show a text but nothing shows up. Debug says that evertyhing is working perfectly but it is not.
Here is code
using UnityEngine;
using System.Collections;
public class glowny : MonoBehaviour {
int i, k;
int lapacz;
void wylosowany(int lapacz){
Debug.Log("to dziala?");
Debug.Log(lapacz);
if(lapacz == 0){
GUI.Label(new Rect(10, 10, 200, 300), "pytanie 1");
Debug.Log("wykonuje sie 0");
}
if(lapacz == 1){
GUI.Label(new Rect(10, 10, 200, 300), "pytanie 2");
Debug.Log("wykonuje sie 1");
}
}
void OnGUI(){
if(GUI.Button(new Rect(100,100,100,100), "losuj")){
i = Random.Range(0, 2);
Debug.Log(i);
wylosowany(i);
}
}
}