unity3d浅析InvokeRepeating重复定时器的示例

using UnityEngine;
using System.Collections;

public class Test : MonoBehaviour {

  void Start () {
    InvokeRepeating("launchProjectile", 1,5);//1秒后调用launchProjectile方法,之后每5秒调用一次
  }

  private void launchProjectile() {
    Debug.Log("aaaaaa");
  }
}

 

未经允许不得转载:第一Unity3D » unity3d浅析InvokeRepeating重复定时器的示例

赞 (0)