public extern void InvokeRepeating (string methodName, float time, float repeatRate);//函数名,多久之后开始,之后每隔多长时间执行一次
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 () {
}
void LaunchProjectile () {
print("hello");
}
}