2011-06-27から1日間の記事一覧
function OnGUI () { if (GUI.Button (Rect (10,10,150,100), "I am a button")) { print ("You clicked the button!"); } create emptyしたものにこのスクリプトをドラッグすれば表示されます。 function OnGUI () { if (GUI.Button (Rect (10,10,100,50), …
yield WaitForSeconds(5.0);var spawnOBJ : GameObject; private var busy = false; //プライベート変数はこのスクリプト内でのみ参照できる変数で、インスペクター上でも表示されません function DoSpawn () { if (!busy){ busy = true; yield WaitForSecon…
■Update () ■FixedUpdate() Update 同様ゲーム画面が更新されたときに実行されます。但し、Update と違い、フレーム間の時間は処理の重さにかかわらず常に一定です。 Rigidbodyなど物理演算を使用する命令の場合はこちらを使用することが 一般的です。 ■Awak…
function Update () { transform.Translate(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical")); } これをカメラにセットしたら「カメラが」動く.
http://unity3d.com/support/documentation/ScriptReference/KeyCode.html
var playerObj : GameObject; var aTexture : Texture; function OnGUI () { var pivotPoint : Vector2 = Vector2(35, 35); var angleY : float = playerObj.transform.localEulerAngles.y; GUIUtility.RotateAroundPivot(angleY, pivotPoint); GUI.DrawText…