标签:
using UnityEngine; using System.Collections; public class fire : MonoBehaviour { public float rate = 0.2f; public GameObject bullet; private void Start() { OnFire(); } //实例化子弹 public void Fire() { GameObject.Instantiate(bullet, transform.position, Quaternion.identity); } //如何实例化子弹 public void OnFire() { InvokeRepeating("Fire",2,rate); } }
标签:
原文地址:http://www.cnblogs.com/fuperfun/p/5341435.html