#pragma strict
var TranslaSpeed=20;
var RotateSpeed=1000;
function Start () {
}
function Update () {
}
function OnGUI()
{
GUI.backgroundColor=Color.red;
if(GUI.Button(Rect(10,10,70,30),"向左旋转"))
{
transform.Rotate(Vector3.up*Time.deltaTime*(-RotateSpeed));
}
if(GUI.Button(Rect(90,10,70,30),"向前移动"))
{
transform.Translate(Vector3.forward*Time.deltaTime*TranslaSpeed);
}
if(GUI.Button(Rect(170,10,70,30),"向右旋转"))
{
transform.Rotate(Vector3.up*Time.deltaTime*RotateSpeed);
}
if(GUI.Button(Rect(90,50,70,30),"向后移动"))
{
transform.Translate(Vector3.forward*Time.deltaTime*(-TranslaSpeed));
}
if(GUI.Button(Rect(10,50,70,30),"向左移动"))
{
transform.Translate(Vector3.right*Time.deltaTime*TranslaSpeed);
}
if(GUI.Button(Rect(170,50,70,30),"向右移动"))
{
transform.Translate(Vector3.right*Time.deltaTime*(-TranslaSpeed));
}
}