- Home /
Unity Editor's Inspector Glitch while using OnGUI function
I don't know exactly how to explain it, so i'll post images to help
Whenever i try to create simple buttons, using OnGUI function (all codes are C#), somehow my editor have some kind of Glitch on the inspector, which make all itens become strangely deformed, as if they were buttons. It is weird, and it's driving me crazy, please help
Here my simple code:
using UnityEngine;
using System.Collections;
public class ContainerControl : MonoBehaviour{
public ParticleSystem particleReference;
void OnGUI(){
if(GUI.Button(new Rect(680,500,100,20),"Azul")){
particleReference.startColor = new Color(0,0,0.5f,1);
print("Azul");
}
if(GUI.Button(new Rect(680,530,100,20),"Vermelho")){
particleReference.startColor = new Color(0.5f,0,0,1);
print("Vermelho");
}
if(GUI.Button(new Rect(680,560,100,20),"Verde")){
particleReference.startColor = new Color(0,0.5f,0,1);
print("Verde");
}
}
}
Normal:
Glitch:
normal.jpg
(350.0 kB)
glitch.jpg
(360.3 kB)
Comment
Your answer
Follow this Question
Related Questions
Strange graphical bug in Editor GUI 1 Answer
Tartan plaid flannel background in editor while scrolling through zoom levels 0 Answers
Game works fine in editor, but build fails with 59 error in the console 2 Answers
My UI is glitching and i have to disable then enable it again 0 Answers
Unity Editor deselects item after clicking on its controls. 4 Answers