using UnityEngine;
using System.Collections;
public class NewBehaviourScript : MonoBehaviour {
// Use this for initialization
void Start () {
InvokeRepeating("LaunchProjectile", 1,5);//1秒后调用LaunchProjectile () 函数,之后每5秒调用一次
}
// Update is called once per frame
void Update () {
if (Input.GetButton ("Fire")) {
CancelInvoke();
}
}
void LaunchProjectile () {
print("hello");
} 作者: hyui 时间: 2014-10-1 22:23
great article 作者: oelongeo 时间: 2014-10-1 22:33
谢谢指导 顶一顶作者: soulhez 时间: 2014-10-2 00:20
It's a primary program.