3월, 2016의 게시물 표시

포커스 컨트롤 사용하기 텍스트 필드 포커스 이동 GUI.FocusControl("");

http://www.devkorea.co.kr/reference/Documentation/ScriptReference/GUI.FocusControl.html GUI .FocusControl( "" ); // 포커스 아웃 // "사용자 이름"Textfield 선택된 때, 버튼을 누르면. var username : String = "username" ; var pwd : String = "a pwd" ; function OnGUI () { //textfield 집합 내부 이름 GUI.SetNextControlName ( "MyTextField" ); // 실제 텍스트 필드를 확인합니다. username = GUI.TextField ( Rect (10,10,100,20), username); pwd = GUI.TextField ( Rect (10,40,100,20), pwd); // 사용자가이 버튼을 누를 경우 키보드 포커스가 이동합니다. if ( GUI.Button ( Rect (10,70,80,20), "Move Focus" )) GUI.FocusControl ( "MyTextField" ); }

문자 첫번째 문자 지우기 , 마지막 문자 지우기

if  (option ==  "first" )             {                 textLength = text.Length;                 text = text.Substring(1, textLength - 1);             }              else             {                 textLength = text.Length;                 text = text.Substring(0, textLength - 1);             }