#pragma strict
function Start () {
}
var run =0;
var isOn:boolean;
var RotateSpeed = 1000;
function Update () {
if (Input.touchCount == 1)
{
if(isOn == true){
isOn=false;
} else{
isOn=true;
}
//One finger touch does orbit
//
// touch = Input.GetTouch(0);
//
// x += touch.deltaPosition.x * xSpeed * 0.02;
//
// y -= touch.deltaPosition.y * ySpeed * 0.02;
}
if(isOn == true){
transform.Rotate(Vector3.up * Time.deltaTime * (-RotateSpeed));
}
}
function OnGUI()
{
//开关按钮,使用了三目运算符来控制显示on或者off
if(GUI.Button(Rect(0,0,200,40),(isOn)?"on":"off"))
{
//用三目运算符控制布尔类型开关变量值
if(isOn==true){
isOn=false;
}else{
isOn=true;
}
}
if(isOn)
{
//其他按钮的代码
}
}
function Start () {
}
var run =0;
var isOn:boolean;
var RotateSpeed = 1000;
function Update () {
if (Input.touchCount == 1)
{
if(isOn == true){
isOn=false;
} else{
isOn=true;
}
//One finger touch does orbit
//
// touch = Input.GetTouch(0);
//
// x += touch.deltaPosition.x * xSpeed * 0.02;
//
// y -= touch.deltaPosition.y * ySpeed * 0.02;
}
if(isOn == true){
transform.Rotate(Vector3.up * Time.deltaTime * (-RotateSpeed));
}
}
function OnGUI()
{
//开关按钮,使用了三目运算符来控制显示on或者off
if(GUI.Button(Rect(0,0,200,40),(isOn)?"on":"off"))
{
//用三目运算符控制布尔类型开关变量值
if(isOn==true){
isOn=false;
}else{
isOn=true;
}
}
if(isOn)
{
//其他按钮的代码
}
}