I found it is difficult to judge which case to use UI in script or assign it in the hierarchy:
I usually do it like this in script:
void OnGUI(){
// GUI.Label(XXX)
if (GUI.Button (new Rect (Screen.Width * .5f, Screen.Height * .5f, 100, 100), "button")){
// do something
}
}
It is convenient to control it in the script. But dont work properly in different resolution.
So I try to use it in hierarchy, it work properly in different resolution, but not convenient to control.
So I want to know that which case to use which one of them will perform better.