usingSystem.Collections;usingSystem.Collections.Generic;usingUnityengine; Public classGui:monobehaviour {stringEditname; stringEditpassword; floatToolBarValue0; floattoolBarValue1; PublicTexture Tex; voidStart () {editname="Please enter user name"; Editpassword="Please enter your password"; ToolBarValue0=0; ToolBarValue1=0; } voidOngui () {GUI. Label (NewRect (Ten,Ten, -, -),"Ali Learning");//to display a string on the screenGUI. Drawtexture (NewRect (Ten, -, -, the), Tex);//Draw a map//detection Button if(GUI. Button (NewRect (Ten, $, -, -),"Normal button") {Debug.Log ("Press the button. "); } //Detect continuous Buttons if(GUI. RepeatButton (NewRect (Ten, -, -, -),"Continuous button") {Debug.Log ("pressing the button! "); } //Set text input boxEditname = GUI. TextField (NewRect ( Max, +, $, -), Editname, the); Editpassword= GUI. Passwordfield (NewRect ( Max, the, $, -), Editpassword,"*"[0], the);
//vertical and horizontal slide barsToolBarValue0 = GUI. Verticalslider (NewRect ( $, $, -, -), ToolBarValue0, -,0); ToolBarValue1= GUI. Horizontalslider (NewRect ( $, the, -, -), ToolBarValue1,0, -); }}
Unity Traditional GUI Learning one.