您的位置:首页 > 其它

InvokeRepeating简单实用

2014-04-18 08:53 197 查看
using UnityEngine;
using System.Collections;
public class danji : MonoBehaviour {
bool a;
// Use this for initialization
void Start () {
}

// Update is called once per frame
void Update () {

}
void OnMouseUp()
{
CancelInvoke ();
a = false;
}
void OnMouseDown(){
a = true;
//	 Invoke ("cc",1);
InvokeRepeating ("cc",2,0.3f);
}
void OnMouseDrag()
{
transform.position += new Vector3(0,4,0);
}
void cc()
{
Debug.Log ("hehe!");
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  InvokeRepeating