- 最后登录
- 2016-8-29
- 注册时间
- 2012-8-25
- 阅读权限
- 90
- 积分
- 23585
- 纳金币
- 20645
- 精华
- 62
|
- 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”);
-
- }
-
- }
复制代码 |
|