状态切换测试

#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;

     }

  }

}

  

你可能感兴趣的:(测试)