Dbutton.js

유니티 동적 버튼 생성

1 예제 코드[ | ]

@script ExecuteInEditMode()

var x:float = 10;
var y:float = 10;
var width:float = 300;
var height:float = 120;
var text = "Click me";
var skin:GUISkin = null;

function OnGUI () {
	GUI.matrix = Matrix4x4.TRS (Vector3(0, 0, 0), Quaternion.identity, Vector3(Screen.width / General.stdWidth, Screen.height / General.stdHeight, 1));
	GUI.skin = skin;
	if (GUI.Button(Rect(x, y, width, height), text)) {
		Debug.Log("Clicked");
	}
}

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}