状态切换测试

#pragma strict
var t:GUIText;
var y:float = 0.1;
function Start () {

}

function Update () {

  if (Input.touchCount > 0) {
    if(Input.GetTouch(0).phase == TouchPhase.Began ){
	     if((Time.time - y) < 0.3){
	     
		       t.text = "gun";
		       animation.CrossFade("Run");
	       
	       }else{
	       
		        t.text = "pao";
		        animation.CrossFade("Walk");
	        }
	       
	     y = Time.time;
     }
  }
}

  

posted @ 2012-08-05 13:20  softimagewht  阅读(203)  评论(0编辑  收藏  举报